InstagramTwitterSnapChat


 
وصف

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


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

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

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

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

Amo0ol-92 Amo0ol-92 غير متواجد حالياً

جامعي

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


السؤال الثاني بأحط لك الحل وانتِ فهميه نفسك هو سهل و واضح بس تشوفي الحل بتفهميه ان شاءالله

Solution:

Problem Analysis Chart:

Given Data Required Results
radiusInInches
depthInFeet
CUBIC_FEET_PER_GALLON = 7.48
PI = 3.14159 gallons
Processing Required Solution Alternatives
radiusInFeet = radiusInInches / 12
volumeOfWell =
galons = volumeOfWell * CUBIC_FEET_PER_GALLON = 7.48
gallons = (int) ((Math.PI * (radius / 12.0) * (radius / 12.0) * depth) * CUBIC_FEET_PER_GALLON);


Algorithm:

1. Readradius from user.
2. Read depth from user.
3. Read Age from user.
4. Convert entered radius from inches to feet.
5. Calculate volume of well.
6. Calculate number of gallons in well.
7. Display number of gallons in well.









Sample Code Solution:

Solution:

import java.util.Scanner;

public class WaterWell
{
public static final double CUBIC_FEET_PER_GALLON = 7.48;

public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int radius;
int depth;
int gallons; // This could be a double, it's not specified in the problem

System.out.println("This program calculates how much water will be available in a well.");
System.out.println("What is the radius of the casing in inches?");
radius = keyboard.nextInt();
System.out.println("What is the depth of the well in feet?");
depth = keyboard.nextInt();

// Compute gallons, first converting the radius to feet, then computing the volume
// and multiplying by the conversion factor of cubic feet to gallons
gallons = (int) ((Math.PI * (radius / 12.0) * (radius / 12.0) * depth) * CUBIC_FEET_PER_GALLON);

System.out.println("The well contains " + gallons + " gallons.");
}
}
رد مع اقتباس

 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 05-10-2012, 02:58 PM   #2

loffe

جامعي

 
تاريخ التسجيل: Aug 2012
نوع الدراسة: إنتظام
المستوى: الثالث
الجنس: أنثى
المشاركات: 8
افتراضي رد: مساعدة في برمجة 202

المشاركة الأصلية كتبت بواسطة amo0ol-92 مشاهدة المشاركة
السؤال الثاني بأحط لك الحل وانتِ فهميه نفسك هو سهل و واضح بس تشوفي الحل بتفهميه ان شاءالله

solution:

Problem analysis chart:

Given data required results
radiusininches
depthinfeet
cubic_feet_per_gallon = 7.48
pi = 3.14159 gallons
processing required solution alternatives
radiusinfeet = radiusininches / 12
volumeofwell =
galons = volumeofwell * cubic_feet_per_gallon = 7.48
gallons = (int) ((math.pi * (radius / 12.0) * (radius / 12.0) * depth) * cubic_feet_per_gallon);


algorithm:

1. Readradius from user.
2. Read depth from user.
3. Read age from user.
4. Convert entered radius from inches to feet.
5. Calculate volume of well.
6. Calculate number of gallons in well.
7. Display number of gallons in well.









Sample code solution:

Solution:

Import java.util.scanner;

public class waterwell
{
public static final double cubic_feet_per_gallon = 7.48;

public static void main(string[] args)
{
scanner keyboard = new scanner(system.in);
int radius;
int depth;
int gallons; // this could be a double, it's not specified in the problem

system.out.println("this program calculates how much water will be available in a well.");
system.out.println("what is the radius of the casing in inches?");
radius = keyboard.nextint();
system.out.println("what is the depth of the well in feet?");
depth = keyboard.nextint();

// compute gallons, first converting the radius to feet, then computing the volume
// and multiplying by the conversion factor of cubic feet to gallons
gallons = (int) ((math.pi * (radius / 12.0) * (radius / 12.0) * depth) * cubic_feet_per_gallon);

system.out.println("the well contains " + gallons + " gallons.");
}
}
معليش مافهمت ممكن توضحي

 

loffe غير متواجد حالياً   رد مع اقتباس
 

إضافة رد


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

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

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

 


الساعة الآن 09:07 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