InstagramTwitterSnapChat


 
وصف

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


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

برمجة 202 - الله يخليكم ساعدوني مو فااااااهمة المسألة مزبوط ..؟!

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

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

مستجدة2 مستجدة2 غير متواجد حالياً

جامعي

 
تاريخ التسجيل: Oct 2011
نوع الدراسة: إنتظام
الجنس: أنثى
المشاركات: 47
Skaau.com (15) برمجة 202 - الله يخليكم ساعدوني مو فااااااهمة المسألة مزبوط ..؟!



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

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




Painting a Room
File Paint.java contains the partial program below, which when complete will calculate the amount of paint needed to paint the walls of a room of the given length and width. It assumes that the paint covers 350 square feet per gallon.
//*
//File: Paint.java
//
//Purpose: Determine how much paint is needed to paint the walls
//of a room given its length, width, and height
//*
import java.util.Scanner;
public class Paint
{
public static void main(String[] args)
{
final int COVERAGE = 350; //paint covers 350 sq ft/gal
//declare integers length, width, and height;
//declare double totalSqFt;
//declare double paintNeeded;
//declare and initialize Scanner object
//Prompt for and read in the length of the room
//Prompt for and read in the width of the room
//Prompt for and read in the height of the room
//Compute the total square feet to be painted--think
//about the dimensions of each wall
//Compute the amount of paint needed
//Print the length, width, and height of the room and the
//number of gallons of paint needed.
}
}
Save this file to your directory and do the following:
1. Fill in the missing statements (the comments tell you where to fill in) so that the program does what it is supposed to.
Compile and run the program and correct any errors.
2. Suppose the room has doors and windows that don't need painting. Ask the user to enter the number of doors and number of windows in the room, and adjust the total square feet to be painted accordingly. Assume that each door is 20 square feet and each window is 15 square feet.




التعديل الأخير تم بواسطة asma'a ; 12-10-2012 الساعة 05:29 PM.
رد مع اقتباس

 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 12-10-2012, 12:55 AM   #2

loOok

جامعي

 
تاريخ التسجيل: Dec 2011
التخصص: ...
نوع الدراسة: إنتظام
المستوى: الرابع
الجنس: أنثى
المشاركات: 138
افتراضي رد: الله يخليكم ساعدوني مو فااااااهمة

يب زيك كمان فكرت ماعرفت اطلع القانون منها "(

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 12-10-2012, 01:10 AM   #3

طُهر

لا زلتُ أَكْتُبُنِي ..

الصورة الرمزية طُهر

 
تاريخ التسجيل: Jan 2012
التخصص: نظم معلومات حاسوبيه
نوع الدراسة: إنتظام
المستوى: الرابع
الجنس: أنثى
المشاركات: 124
افتراضي رد: الله يخليكم ساعدوني مو فااااااهمة

يب انا كمان مفروض اسلمه بكرا بس ماعرفت له هوا ودا كمان
Base Conversion
One algorithm for converting a base 10 number to another base b involves repeatedly dividing by b. Each time a division is performed the remainder and quotient are saved. At each step, the dividend is the quotient from the preceding step; the divisor is always b. The algorithm stops when the quotient is 0. The number in the new base is the sequence of remainders in reverse order (the last one computed goes first; the first one goes last).
In this exercise you will use this algorithm to write a program that converts a base 10 number to a 4-digit number in another base (you don't know enough programming yet to be able to convert any size number). The base 10 number and the new base (between 2 and 9) will be input to the program. The start of the program is in the file BaseConvert.java. Save this file to your directory, then modify it one step at a time as follows:
1. The program will only work correctly for base 10 numbers that fit in 4 digits in the new base. We know that in base 2 the maximum unsigned integer that will fit in 4 bits is 11112 which equals 15 in base 10 (or 24– 1). In base 8, the maximum number is 77778 which equals 4095 in base 10 (or 84 – 1). In general, the maximum base 10 number that fits in 4 base b digits is b4 – 1. Add an assignment statement to the program to compute this value for the base that is input and assign it to the variable maxNumber. Add a statement that prints out the result (appropriately labeled). Compile and run the program to make sure it is correct so far.
2. Now add the code to do the conversion. The comments below guide you through the calculations—replace them with the appropriate Java statements.

// First compute place0 -- the units place. Remember this comes
// from the first division so it is the remainder when the
// base 10 number is divided by the base (HINT %).
// Then compute the quotient (integer division / will do it!) -
// You can either store the result back in base10Num or declare a
// new variable for the quotient
// Now compute place1 -- this is the remainder when the quotient
// from the preceding step is divided by the base.
// Then compute the new quotient
// Repeat the idea from above to compute place2 and the next quotient
// Repeat again to compute place3

3. So far the program does not print out the answer. Recall that the answer is the sequence of remainders written in reverse order— note that this requires concatenating the four digits that have been computed. Since they are each integers, if we just add them the computer will perform arithmetic instead of concatenation. So, we will use a variable of type String.
Note near the top of the program a variable named baseBNum has been declared as an object of type String and initialized to an empty string. Add statements to the program to concatenate the digits in the new base to baseBNum and then print the answer. Compile and run your program. Test it using the following values: Enter 2 for the base and 13 for the base 10 number—the program should print 1101 as the base 2 value; enter 8 for the base and 1878 for the number— the program should print 3526 for the base 8 value; enter 3for the base and 50 for the number—the program should print 1212.

// *
// BaseConvert.java
//
// Converts base 10 numbers to another base
// (at most 4 digits in the other base). The
// base 10 number and the base are input.
// *
import java.util.Scanner;
public class BaseConvert
{
public static void main (String[] args)
{
int base; // the new base
int base10Num; // the number in base 10
int maxNumber; // the maximum number that will fit
// in 4 digits in the new base
int place0; // digit in the 1's (base^0) place
int place1; // digit in the base^1 place
int place2; // digit in the base^2 place
int place3; // digit in the base^3 place
String baseBNum = new String (""); // the number in the new base
Scanner scan = new Scanner(System.in);
// read in the base 10 number and the base
System.out.println();
System.out.println ("Base Conversion Program");
System.out.println() ;
System.out.print ("Please enter a base (2-9): ");
base = scan.nextInt();
// Compute the maximum base 10 number that will fit in 4 digits
// in the new base and tell the user what range the number they
// want to convert must be in
System.out.print ("Please enter a base 10 number to convert: ");
base10Num = scan.nextInt();
// Do the conversion (see notes in lab)
// Print the result (see notes in lab)
}
}



ياليت احد يساعدنا والله مرا حايسه فيه واستاذتنا سيئه ماشرحت افكار ولا شيءنقرتين لعرض الصورة في صفحة مستقلة

 

توقيع طُهر  

 

سيد الاستغ ـفآر
اللهم أنت ربي لا إله إلا أنت خ ـلقتني و أنآ عبدك و أنآ على عهدك و وع ـدك مااستطعت ,
أعوذ بك من شر مآ صنعت و أبوء لك بنعمتك علي وأبوء بذنبي..
فاغفر لي فإنه لا يغفر الذنوب إلا أنت..

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 12-10-2012, 01:18 AM   #4

loOok

جامعي

 
تاريخ التسجيل: Dec 2011
التخصص: ...
نوع الدراسة: إنتظام
المستوى: الرابع
الجنس: أنثى
المشاركات: 138
افتراضي رد: الله يخليكم ساعدوني مو فااااااهمة

اللي يعرف يحلو ياريت ونحنا نفهم شرح الكود عشان الوقت مرآ ضيق ماراح يمدي نجلس نفكر خلاص "(

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 12-10-2012, 01:23 AM   #5

عاشق الحاسب

جامعي

الصورة الرمزية عاشق الحاسب

 
تاريخ التسجيل: May 2008
التخصص: علوم الحاسب
نوع الدراسة: ماجستير
المستوى: متخرج
الجنس: ذكر
المشاركات: 42
افتراضي رد: الله يخليكم ساعدوني مو فااااااهمة

بما اني فاضي.. بحاول ان شاء الله ياللي اقدر عليه

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 12-10-2012, 02:08 AM   #6

عاشق الحاسب

جامعي

الصورة الرمزية عاشق الحاسب

 
تاريخ التسجيل: May 2008
التخصص: علوم الحاسب
نوع الدراسة: ماجستير
المستوى: متخرج
الجنس: ذكر
المشاركات: 42
افتراضي رد: الله يخليكم ساعدوني مو فااااااهمة

هذا تقريبا اجتهادي في حل الفقرة الاولي من سوال الاخت مستجدة
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package javaapplication2;
import java.util.Scanner;

/
*
* @author ahmed ali
*/
public class JavaApplication2 {

/
* @param args the command line arguments
*/
public static void main(String[] args) {
final int COVERAGE = 350; //paint covers 350 sq ft/gal
int length, width,height; //declare integers length, width, and height;
double totalSqFt; //declare double totalSqFt;
double paintNeeded; //declare double paintNeeded;
Scanner sc = new Scanner(System.in);

System.out.println( "Please enter the length of the room: " );
length = sc.nextInt();

System.out.println( "Please enter the width of the room: " );
width = sc.nextInt();

System.out.println( "Please enter the height of the room: " );
height = sc.nextInt();

totalSqFt=(2*length*height)+ (2*width*height);//Compute the total square feet to be painted

paintNeeded= totalSqFt / COVERAGE;//Compute the amount of paint needed

System.out.printf("\nThe length of the room is %d",length);
System.out.printf("\nnThe width of the room is %d",width);
System.out.printf("\nThe height of the room is %d",height);

System.out.printf("\nThe number of gallons of paint needed is %f",paintNeeded," gallons. \n");
paintNeeded= Math.ceil(paintNeeded);
System.out.printf(" so you have to purchase %f",paintNeeded," gallons. \n");
}
}

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 12-10-2012, 03:31 AM   #7

عاشق الحاسب

جامعي

الصورة الرمزية عاشق الحاسب

 
تاريخ التسجيل: May 2008
التخصص: علوم الحاسب
نوع الدراسة: ماجستير
المستوى: متخرج
الجنس: ذكر
المشاركات: 42
افتراضي رد: الله يخليكم ساعدوني مو فااااااهمة

تكملة سؤال الاخت مستجدة.. طبعا هذا مجود شخصي وقد اصيب او اخطا.. بالتوفيق للجميع
تنبيه الرجاء الانتباه ومراجعة الكود كامل ومحاولة التغيير حتى لاتكون الاجابات متشابهه

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package javaapplication2;
import java.util.Scanner;

/
*
* @author ahmed ali
*/
public class JavaApplication2 {

/
* @param args the command line arguments
*/
public static void main(String[] args) {
final int COVERAGE = 350; //paint covers 350 sq ft/gal
int length, width,height; //declare integers length, width, and height;
double totalSqFt; //declare double totalSqFt;
double paintNeeded; //declare double paintNeeded;
int doors,windows; //number of doors and windows
double room_withNo_windows,room_withNo_doors,final_total; //total without doors and windows
Scanner sc = new Scanner(System.in);

System.out.println( "Please enter the length of the room: " );
length = sc.nextInt();

System.out.println( "Please enter the width of the room: " );
width = sc.nextInt();

System.out.println( "Please enter the height of the room: " );
height = sc.nextInt();

totalSqFt=(2*length*height)+ (2*width*height);//Compute the total square feet to be painted

paintNeeded= totalSqFt / COVERAGE;//Compute the amount of paint needed

System.out.printf("\nThe length of the room is %d",length);
System.out.printf("\nnThe width of the room is %d",width);
System.out.printf("\nThe height of the room is %d",height);

System.out.printf("\nThe number of gallons of paint needed is %f",paintNeeded," gallons. \n");
System.out.printf(" so you have to purchase %.0f",Math.ceil(paintNeeded)," gallons. \n");


System.out.println( "\nPlease enter the number of doors in the room: " );
doors = sc.nextInt();
room_withNo_doors = doors *20;
System.out.println( "Please enter the number of windows in the room: " );
windows= sc.nextInt();
room_withNo_windows = windows * 15;

final_total = room_withNo_doors+room_withNo_windows;
final_total= final_total/COVERAGE;
paintNeeded = paintNeeded - final_total;
System.out.printf("\nThe number of gallons of paint needed is %.0f",Math.ceil(paintNeeded)," gallons. \n");

}
}

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 12-10-2012, 04:54 PM   #8

مستجدة2

جامعي

 
تاريخ التسجيل: Oct 2011
نوع الدراسة: إنتظام
الجنس: أنثى
المشاركات: 47
افتراضي رد: الله يخليكم ساعدوني مو فااااااهمة

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

 

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

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

loOok

جامعي

 
تاريخ التسجيل: Dec 2011
التخصص: ...
نوع الدراسة: إنتظام
المستوى: الرابع
الجنس: أنثى
المشاركات: 138
افتراضي رد: برمجة 202 - الله يخليكم ساعدوني مو فااااااهمة المسألة مزبوط ..؟!

الله يجزاك كل خير بس ابغى اعرف شغله ليش استخدم ( pritif ) !!

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 12-10-2012, 07:04 PM   #10

asma'a

مشرفة مُتألقة سابقة

الصورة الرمزية asma'a

 
تاريخ التسجيل: Oct 2008
كلية: كلية الحاسبات وتقنية المعلومات
التخصص: CS ولله الحمد ^^..
نوع الدراسة: إنتظام
المستوى: متخرج
البلد: جــــدة
الجنس: أنثى
المشاركات: 1,514
افتراضي رد: برمجة 202 - الله يخليكم ساعدوني مو فااااااهمة المسألة مزبوط ..؟!

^

printif للتنسيق ^^..

بس يمديكي تستغني عنها بـ print أو println

بالتوفيق ..

دمتـِ بخير ..

 

توقيع asma'a  

 

الحسد يجعل بعض الناس يلجؤوا الى طرق خبيثة وملتوية للتقليل من شأن ( الناجحين )
بسبب ضعف الشخصية و الإنهزامية لديهم

ودائما الحاسد يظل في المؤخرة ..

لـ/ ـلؤي نسيم || Loai Nassem ..


*.*.*.*.*.*

يقول الرب جل وعلا: " فَاسْتَجَابَ لَهُ رَبُّهُ فَصَرَفَ عَنْهُ كَيْدَهُنَّ إِنَّهُ هُوَ السَّمِيعُ الْعَلِيمُ " سورة يُوسف (34)

 

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

إضافة رد


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

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

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

 


الساعة الآن 05:54 PM


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

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

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

2003-2023