الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

برنامج في C++

بدأه مخالف_45 في 16 مايو 2008 · 11 رد · 1,174 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله

انا حاب اطلب منكم طلب واتمنى ماتخيبوني وخصوصا ان هذي اول مشاركه لي واذا ساعدتوني اكيد راح اساعدكم

انا عندي برنامج مو عارفه كيف احله اتمنى انكم تساعدوني

وهذا هو البرنامج:

Write a program that asks the user’s height, weight, and age, and the computes clothing

sizes according to the formulas:

1: Hat size = weight in pounds divided by height in inches and all that multiplied by 2.9.

2: Jacket size (chest in inches) = height times weight divided by 288 and the adjusted by adding 1/8 of an inch for each 10 years over age 30. (Note that the adjustment only takes place after a full 10 years, so there is no adjustment for ages 30 through 39, but 1/8 inch is added for age 40.)

3: Waist size = weight divided by 5.7 and then adjusted by adding 1/10 of an inch for each 2 years over age 28.(Note that the adjustment only takes place after full 2 years. So, there is no adjustment for age 29, but 1/10 of an inch is added for age 30.)

Use function for each calculation. The program should allow the user to repeat this calculation as often as the user wishes.

The out put should look like this: (this is an example)

Give me your height in inches, weight in pounds, and age in years

and I will give you your hat size, jacket size (inches at chest) and your waist size in inches.

69

185

50

Hat size= 7.78

Jacket size= 44.57

Waist size= 33.56

Enter y or Y to repeat, any other character ends.

Y

The out put should look like this : (this is an example)

Give me your height in inches, weight in pounds, and age in years

and I will give you your hat size, jacket size (inches at chest) and your waist size in inches.

ومشكورين مقدما والله يجزاكم الف خير

ملاحظه : ابغى البرنامج اليوم ضروري ضروري عارفه اني متأخره بس عشان اني كنت احاول احله.

#2

على فكره السؤال موجود في كتاب

problem solving with C++ 6th edition

سؤال 9 صفحه 244 capter 4

#3

أنا كتبت برنامج بس ابي احد الخبراء يشوف لي ايش ناقص فيه وايش الخطأ؟؟ بسرعه الله يجزاكم الف خير

#include <iostream>

double hat_size(double weight, double hight);

double jacket_size(double weight, double hight, int age);

double waist_size(double weight, int age);

int main()

{

using namespace std;

double weight, height;

int age;

cout<<"Give me your height in inches, weight in pounds, and age in years"

<<"and I will give you your hat size, jacket size (inches at chest)"

<<"and your waist size in inches.\n";

cin>> weight

>> height

>> age;

hat_size(weight, height);

cout<< "hat size = \n";

jacket_size(weight, height, age);

cout<< "jacket size = \n";

waist_size(weight, age);

cout<< "waist size = \n";

return 0;

}

double hat_size(double weight, double height)

{

using namespace std;

return ((weight/height)*2.9);

}

double jacket_size(double weight, double height, int age)

{

using namespace std;

if (age<=30)

return ((height*weight)/288);

}

double waist_size(double weight, int age)

{

using namespace std;

if (age<=28)

return (weight/5.7);

#4

معقول 37 قروا الموضوع ولا احد رد :(

لو بس تعطوني امل ان احد يقدر يساعدني بليييز

#5
hat_size(weight, height);

cout<< "hat size = \n";

jacket_size(weight, height, age);

cout<< "jacket size = \n";

waist_size(weight, age);

cout<< "waist size = \n";

خليها كدة >

cout<< "hat size = \n" << hat_size(weight, height);

cout<< "jacket size = \n" << jacket_size(weight, height, age);

cout<< "waist size = \n" << waist_size(weight, age);

و ناقصلك فى ال jacket_size إنك تحدد ال return value لو العمر أكبر من 30.

و كمان فى ال waist_size!

تم تعديل هذه المشاركة بواسطة Blueteeth في 16 مايو 2008 في 15:12

#6

مشكور اخوي وماقصرت الله يجزالك الف خير بس ممكن توضح كيف اخر شي يصير لاني مافهمت

والله يعطيك الف عافيه ويحقق لك اللي في بالك

#7

بليييييييييييز حد يساعدني خلاص تعبت :( الله يعافيكم

ابي اعرف كيف اسوي functions defiinition for hat size, jacket size , waist size

#8
double jacket_size(double weight, double height, int age)

{

if (age<=30)

return ((height*weight)/288);

else
   return ((height*weight)/288) + ((age-30)%10) * 1.0/8;

}

و نفس الطريقى فى ال waist_size مع إختلاف الأرقام طبعا.

#9

والله انك ماقصرت وتعبتك معي بس إن شاء الله اردها لك

بس ماضبط معي جربت نفس المثال الا فوق اول شي الا في الموضوع بس ماطلعت نفس الارقام

ممكن تكتب لي البرنامج كامل

والله يوفقك ويعطيك العافيه

#10

أسف دى غلطتى أنا, المفروض المعامل يبقى قسمة مش باقى, يعنى كدة>

else
   return ((height*weight)/288) + ((age-30)/10) * 1.0/8;

جرب كدة حتلاقيها ظبطت معاك إن شاء الله.

#11

سوري اخوي والله تعبتك بس اللي ضبط معي هو jacket size بس hat size و waist size ماضبطوا

#12

وينكم بليييييييييييز هلب مي

والله اخوي بلوتيث ماقصر معي ابد بس محتاجه مساعدتكم كمان

مواضيع مشابهة