العودة   منتديات طلاب الجامعة العربية المفتوحة > منتدى كليات الجامعة العربية المفتوحة > منتدى تقنية المعلومات والحاسوب > M150B

إضافة رد
 
أدوات الموضوع انواع عرض الموضوع

قديم 21-04-2017, 11:21 PM   #1
jaralamer jaralamer غير متصل
طالب جديد

 










افتراضي TMA M150b 2017


السلام عليكم .. ممكن تساعدوني بحل هذا السؤال


You are required to model a new user-defined object type, ClubMember.
The ClubMember object has the following properties:
name: a string that holds the name of the club member.
height: a number that holds the height (in meters) of the club member.
weight: a number that holds the weight (in kilograms ) of the club member.
dob: a Date object representing the date of birth of the club member.

The ClubMember object type has the following three methods:
calculateAge(): a method that calculates and returns the age of the club
member.
calcBMI(): a method that calculates and returns the Body Mass Index (BMI) of
the member, where BMI is calculated using the following formula:

 = weight/(height)^2

showInfo(): a method that displays the details and health information of the
member including: name, height, weight, date of birth (in the long form), age, BMI,
and whether this person is underweight, normal, overweight or obesity depending
on the BMI.
Depending on the BMI, a person is:
Underweight if the BMI is less or equals to 18.5
Normal weight if the BMI is greater than 18.5 and is less than 25
Overweight if the BMI is greater or equals to 25 and is less than 30
Obesity if the BMI is 30 or more.
The member information should be printed between two colored lines.

Write Java****** code to do the following:
a. Write the constructor function ClubMemebr(aName, aHeight, aWeight,
aDate).
b. Implement the methods calculateAge(), calcBMI()and showInfo()
according to the above specifications.
c. Create a ClubMemebr object and initialize all its properties by values entered by
the user. This should include reading the values for the year, month and day of the
member's date of birth and creating a Date object accordingly.
d. Show the health information of the member you've created using an appropriate
method.
jaralamer غير متصل   رد مع اقتباس
قديم 24-04-2017, 12:44 PM   #2
ahmed2009 ahmed2009 غير متصل
طــالب

 










افتراضي رد: TMA M150b 2017


وعليكم السلام :

ياريت إرفاق ملف الواجب ...
ahmed2009 غير متصل   رد مع اقتباس
قديم 29-04-2017, 04:31 PM   #3
خبر عاجل, خبر عاجل, غير متصل
طالب جديد

 










افتراضي رد: TMA M150b 2017


السؤالين كل واحد اصعب من الثاني

اللي حل الواجب نتمنى ان يعطينا فكرة عن طريقة الحل
خبر عاجل, غير متصل   رد مع اقتباس
قديم 29-04-2017, 07:12 PM   #4
ahmed2009 ahmed2009 غير متصل
طــالب

 










افتراضي رد: TMA M150b 2017


طيب ارفعوا الواجب هنا علشان نقدر نساعدكم ..
ahmed2009 غير متصل   رد مع اقتباس
قديم 29-04-2017, 09:47 PM   #5
خبر عاجل, خبر عاجل, غير متصل
طالب جديد

 










افتراضي رد: TMA M150b 2017


Question 2 [40 marks]
You are required to model a new user-defined object
type,
ClubMember
.
The
ClubMember
object has the following
properties:
name
:
a string that holds the name of the club member.
height
:
a number that holds the height (in meters) of t
he club member.
weight
:
a number that holds the weight (in kilograms ) of t
he club member.
dob
: a
Date
object representing the date of birth of the club
member.
The
ClubMember
object type has the following three
methods
:
calculateAge()
: a method that calculates and returns the age of t
he club
member.
calcBMI()
: a method that calculates and returns the Body Mas
s Index (BMI) of
the member, where BMI is calculated using the follo
wing formula:
 =
weight
(height)
showInfo()
: a method that displays the details and health inf
ormation of the
member including: name, height, weight, date of bir
th (in the long form), age, BMI,
and whether this person is underweight, normal, ove
rweight or obesity depending
on the BMI.
Depending on the BMI, a person is:
Underweight if the BMI is less or equals to
18.5
Normal weight if the BMI is greater than 18.5
and is less than 25
Overweight if the BMI is greater or equal
s to 25 and is less than 30
Obesity
if the BMI is 30 or more.
The member information should be printed between tw
o colored lines.
Write Java****** code to do the following:
a.
Write the constructor function
ClubMemebr(aName, aHeight, aWeight,
aDate).
b.
Implement the methods
calculateAge()
,
calcBMI()
and
showInfo()
according to the above specifications.
c.
Create a
ClubMemebr
object and initialize all its properties by values
entered by
the user. This should include reading the values fo
r the year, month and day of the
member's date of birth and creating a
Date
object accordingly.
d.
Show the health information of the member you've cr
eated using an appropriate
method.
Page
4
/
4
e.
In your Solution document insert two screenshots: [
4]
-
One showing the program prompting for the
Member
name, with you
having entered the name but not yet pressed OK;
-
One showing all the resulted output of the program
.
خبر عاجل, غير متصل   رد مع اقتباس
قديم 30-04-2017, 02:26 PM   #6
ahmed2009 ahmed2009 غير متصل
طــالب

 










افتراضي رد: TMA M150b 2017


طبعا اول شيء لازم تكون عندكم المكتبات في نفس الملف حق الكود علشان يشتغل الكود , وايضا مطلوب صوره اول ما تشغل الصفحة بطلب منك اسم اكتب اسم ولكن خذ صوره قبل ما تضغط زر انتر , والصوره الثانية لما يطبع كل شيء على الصفحة . ولا تنسوا تغيروا بعض الأشياء علشان التشابه ...

الكود :

* طبعا مكان النجوم استبدلوها بكلمة ( s c r i p t) بدون مسافات .. لأنه ممنوع كتابه الكلمه هذي في المنتدى .


كود:
<!DOCTYPE html>
<html>

<head>
<title> M150B Question </title>
  <****** SRC = dateLibrary.js></******>
		<****** SRC = drawingLibrary.js></******>
</head>

<body>



<****** language="java******">

function ClubMember(aName,aHeight,aWeight,aDate)
{

	this.name=aName;
	this.height=aHeight;
	this.weight=aWeight;
	this.date =aDate;
	this.calcBMI = calcBMI;
	this.calculateAge = calculateAge;
	this.setName = setName;
	this.getName = getName;
	this.setHeight=setHeight;
	this.getHeight=getHeight;
	this.getWeight = getWeight;
	this.setWeight = setWeight;
	this.showInfo=showInfo;
}


function calculateAge()
{

var  date1= new Date();
 var age = differenceInYears(date1, this.date);
 

return age;
}

function calcBMI()
{
var BMI  = this.weight/(this.height*this.height);
return BMI;
}

function setName(aString)
{
	this.name =aString;
}
function getName()
{
	return this.name;
}
function setHeight(aNumber)
{
	
	    this.height=aNumber;  
}
function getHeight()
{
	return this.height;
}
function setWeight(aNumber)
{
	
		this.weight=aNumber;
}
function getWeight()
{
	return this.weight;
}

function  showInfo()
{
		var status;
		 var BMI = calcBMI();
			if(BMI <= 18.5)
			status = "UnderWeight";
			else if(BMI > 18.5 && BMI < 25)
			status = "Normal Weigth";
			else if(BMI >= 25 && BMI < 30)
			status = "OverWeigth";
			else if(BMI >= 30)
			status = "Obesity";
			
			


		drawLine(70, "blue", 0);
	document.write("<BR> name: "+this.getName()+"<BR>Height: "+this.getHeight() + "<BR>Weight : "+this.getWeight() +
	 "<BR> Your BirthDay in long form : "+ dateStringLong(this.date) + "<BR> Age = " + this.calculateAge() +
	 "<BR> Your BMI is : " + calcBMI()  + "<BR> Your status are : "+ status + "<BR><BR>");
		drawLine(70, "red", 0);		
			
			
		}
	

var name=window.prompt("Enter the name of club member :");

var day =parseFloat(window.prompt("Enter the day of your birth :"));

var month =parseFloat(window.prompt("Enter the month of your birth :(from 1 to 12)"));

month = month -1;

var year=parseFloat(window.prompt("Enter the year of your birth :",""));

var Cdate = new Date(year,month,day);


var height = parseFloat(window.prompt("Enter the heigth of club member(in meters) : ",""));

var weight = parseFloat(window.prompt("Enter the weight of club member(in kilograms ) :",""));

var ClubMember=new ClubMember(name,height,weight,Cdate);



ClubMember.showInfo();



</******>

</body>

</html>

التعديل الأخير تم بواسطة ahmed2009 ; 30-04-2017 الساعة 02:27 PM
ahmed2009 غير متصل   رد مع اقتباس
قديم 30-04-2017, 03:03 PM   #7
خبر عاجل, خبر عاجل, غير متصل
طالب جديد

 










افتراضي رد: TMA M150b 2017


^^^

مشكوووووور يالغالي

Page
2
/
4
Question 1 [35 marks]
1.
Write a Java****** program that works according to
the following:
a.
Write a function called
biggestEven
that takes an array of numbers as
an argument and returns the biggest even number in
the array.
b.
Read from the user 10 numbers and store them in an
array of 10
elements.
c.
Print the array elements in the output window.
d.
Call the function
biggestEven
and print the result.
e.
In your Solution document insert 2 screenshots:
-
one showing the program prompting for any of the 10
numbers, with
you having entered the value but not yet pressed OK
;
-
one showing the 10 elements of the array and the re
sulted output

هذا السؤال الاخر ، اتمنى انك تلقي نظرة عليه وتعطينا فكرة عنه علماً ان الواجب سيسلم بعد سويعات قليلة
خبر عاجل, غير متصل   رد مع اقتباس
قديم 30-04-2017, 07:18 PM   #8
ahmed2009 ahmed2009 غير متصل
طــالب

 










افتراضي رد: TMA M150b 2017


فيه اتوقع سؤال شبهُ سابق موجود في القسم هنا ممكن تلقي نظره عليه وتقدر تحله بسهوله ان شاء الله.
ahmed2009 غير متصل   رد مع اقتباس
إضافة رد

مواقع النشر (المفضلة)

أدوات الموضوع
انواع عرض الموضوع

تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع


الساعة الآن 03:40 AM.


Powered by vBulletin® Version 3.8.1, Copyright ©2000 - 2019, Jelsoft Enterprises Ltd. TranZ By Almuhajir
جميع المواضيع والمشاركات تعبر عن وجهة نظر أصحابها
ولا تعبر باي شكل من الاشكال عن وجهة نظر منتديات AOUA
تصميم وتطوير : التكنولوجيا الماسية