InstagramTwitterSnapChat


 
وصف

العودة   منتديات سكاو > الكليات الجامعية > منتدى كلية الحاسبات وتقنية المعلومات > المنتدى العام لكلية الحاسبات وتقنية المعلومات
التسجيل مشاركات اليوم البحث
   
   


المنتدى العام لكلية الحاسبات وتقنية المعلومات قسم خاص بالمواد العامة و الطلاب غير المتخصصين بكلية الحاسبات وتقنية المعلومات

مساعدة في برمجة 202

المنتدى العام لكلية الحاسبات وتقنية المعلومات

 
 
أدوات الموضوع إبحث في الموضوع انواع عرض الموضوع
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 28-09-2012, 12:16 PM   #4

Amo0ol-92

جامعي

 
تاريخ التسجيل: Jul 2010
التخصص: IS
نوع الدراسة: إنتظام
المستوى: السابع
الجنس: أنثى
المشاركات: 57
افتراضي رد: مساعدة في برمجة 202

هذا طبعا ً حل دكتوره غاده معانا زمان

Solution:

Problem Analysis Chart:

Given Data Required Results
weight
height
age
numCaloriesChocolateBar numChocolateBarsForFemale

Processing Required Solution Alternatives
caloriesMale= 655 + (4.3 * weight) + (4.7 * height) - (4.7 * age);
numChocolateBarsForMale = caloriesMale / numCaloriesChocolateBar

caloriesFemale = 66 + (6.3 * weight) + (12.9 * height) - (6.8 * age);
numChocolateBarsForWoman = caloriesFemale / numCaloriesChocolateBar
caloriesMale = 655 + (4.3 * weight) + (4.7 * height) - (4.7 * age);

System.out.println("A male with those measurements should eat " +
(caloriesMale / 230) + “candy bars per day to maintain her weight.");


caloriesFemale = 66 + (6.3 * weight) + (12.9 * height) - (6.8 * age);

System.out.println("A female with those measurements should eat " +
(caloriesFemale / 230) + “candy bars per day to maintain her weight.");

Algorithm:

1. Read Weight from user.
2. Read Height from user.
3. Read Age from user.
4. Calculate number of calories a male person can consume without gaining weight.
5. Calculate number of chocolate bars a male person can consumer without gaining weight.
6. Calculate number of calories a female person can consume without gaining weight.
7. Calculate number of chocolate bars a female person can consumer without gaining weight.
8. Displaynumber of calories a male person can consume without gaining weight.
9. Display number of calories a female person can consume without gaining weight.






Sample Code Solution:

import java.util.Scanner;

public class CandyCalculator
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int age;
int weight;
int height;

System.out.println("This program will calculate the number of 230 calorie");
System.out.println("candy bars to eat to maintain your weight.");
System.out.println("What is your age in years?");
age = keyboard.nextInt();
System.out.println("What is your total height in inches?");
height = keyboard.nextInt();
System.out.println("What is your weight in pounds?");
weight = keyboard.nextInt();

double caloriesMale, caloriesFemale;

caloriesMale = 655 + (4.3 * weight) + (4.7 * height) - (4.7 * age);
caloriesFemale = 66 + (6.3 * weight) + (12.9 * height) - (6.8 * age);

System.out.println("A female with those measurements should eat " +
(caloriesFemale / 230) +
" candy bars per day to maintain her weight.");
System.out.println("A male with those measurements should eat " +
(caloriesMale / 230) +
" candy bars per day to maintain her weight.");
}
}

 


التعديل الأخير تم بواسطة Amo0ol-92 ; 28-09-2012 الساعة 12:21 PM.
Amo0ol-92 غير متواجد حالياً   رد مع اقتباس
 

 


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

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

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

 


الساعة الآن 10:03 AM


Powered by vBulletin® Version 3.8.9 Beta 3
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Ads Organizer 3.0.3 by Analytics - Distance Education

أن كل ما ينشر في المنتدى لا يمثل رأي الإدارة وانما يمثل رأي أصحابها

جميع الحقوق محفوظة لشبكة سكاو

2003-2025