InstagramTwitterSnapChat


 
وصف

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


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

دروس خصوصيه في cpcs 202 cpcs 203 + حل بروجكتات

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

موضوع مغلق
 
أدوات الموضوع إبحث في الموضوع انواع عرض الموضوع
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 08-01-2011, 11:05 PM   #11

الجرشي

جامعي

 
تاريخ التسجيل: Dec 2009
نوع الدراسة: تحضيري علمي خطة أ
الجنس: ذكر
المشاركات: 17
افتراضي رد: دروس خصوصيه في cpcs 202 cpcs 203 + حل بروجكتات

الله لا يهينك كيف أخلي هذا البرنامج لوب و لو أدخل المستخدم 0 أو خيار غير المحدد من 1-4 يكتب له خطا بدون ما يطبع أدخل الرقمين

الرجو الرد سريعا لا هنت

كود:
#include<stdio.h>
int main ()

{
	int num1, num2,i=0;
	char Char;
 
	printf("1:(+)\n 2:(-)\n 3:(*)\n 4:(/)\n 0: To Exit \n\n Enter a choice: ");
    scanf("%c",&Char);

	printf("Enter the first number: ");
	scanf("%d",&num1);

	printf("Enter the second number: ");
	scanf("%d",&num2);
	
	if(Char == '+' || Char == '1')
		printf(" %d + %d = %d",num1, num2, num1+num2);

		
	else if(Char == '-' || Char == '2')
		printf(" %d - %d = %d",num1, num2, num1-num2);
		
	

	else if(Char == '*' || Char == '3')
		printf(" %d * %d = %d",num1, num2, num1*num2);

		

	else if (Char == '/' || Char == '4')
		printf(" %d / %d = %d",num1, num2, num1/num2);


	else 
		printf("Error in choice \n");
	
 

	return(0);

}

 


التعديل الأخير تم بواسطة الجرشي ; 08-01-2011 الساعة 11:08 PM.
الجرشي غير متواجد حالياً  
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 10-01-2011, 01:30 PM   #12

mr_stock

جامعي

 
تاريخ التسجيل: Jan 2011
التخصص: IS
نوع الدراسة: إنتظام
المستوى: السادس
الجنس: ذكر
المشاركات: 19
Skaau.com (11) رد: دروس خصوصيه في cpcs 202 cpcs 203 + حل بروجكتات

المشاركة الأصلية كتبت بواسطة رغـــدهـ ~ مشاهدة المشاركة
انا عندي سؤال نقرتين لعرض الصورة في صفحة مستقلة
بالنسبه الى loop وانوعهآ الثلاثه انا فاهمه فكرتهم الاسآسيه
بس السؤال اذا جيت احل كيف ارتب افكاري واحله بطريقه صح
وش الاشياء اللي لازم اسويها قبل كل شي وكذا نقرتين لعرض الصورة في صفحة مستقلة

اول شي لازم تتدربي على طريقه كتابه كود اللوب و تحفظيها تمام 100 %
ثاني شي تحددي هل هي for أو while أو do while
ثالث شي اذا كانت for تنتبهي لعدد اللوبات و تنتبهي للشرط جيدا يعني >= مو زي > تختلف كتير و في الحل تختلف
و تنتبهي للقيمه يلي ساوا فيها هل هي 0 او 1 او اي رقم مثلا :
اذا كانت اللوب زي كدا for (int i = 0; i<= 5;i++ ) //for loop
في هذي الحاله يكون عدد اللوبات 6 لانو بدا من الصفر الى 5 اما اذا كان الشرط >5 راح يكون عدد اللوبات 5 بس هذا الشي كتير الطلاب يلخبطوا فيه في الاختبارات

و بالنسبه للوب داخل اللوب يعني مثلا :

for (i = 1; i <= 2; i++)// loop1
for (j = 1; j <= 3; j++)// loop 2
printf("*"); //star

هنا راح يطبع 6 نجوم يلي هييا عدد اللوبات في اللوب الاولى ضرب عدد اللوبات في اللوب الثانيه = 6 و لا نعتمد على الارقام المكتوبه لازم نحسب اللوبات بنفسنا يعني مو 3 * 2=6 و خلاص لا لازم ننتبه للشروط كويس

مثال 3*2 هدي بتحسبها على عدد اللوب مو على الرقم المكتوب لانو احيانا يعطي قيمه ال i 0 و احيانا 1 يعني في المثال يلي فوق اعطاها 1 فتطلع قيمه اللوب الاولى 2 و الثانيه 3 اما اذا اعطاها قيمه 0 راح يبدا من الصفر فتطلع قيمه اللوب الاولى 3 و الثانيه 4 ولازم تنتبه للشرط هل هو >= أو فقط > لانها تفرق كتير
الخلاصه
لازم تحسب كم لوب في كل وحده و ما تعتمد على الارقام المكتوبه ركزوا

أما while loop و do while هدي سهله مجرد لوب عاديه اذا حقق الشرط يدخل و ينفذ و اذا ما حققوا ما يدخل اللوب
بس الفرق انو do while يدخل في اللوب و ينفذها مره وحده على الاقل بعدين يتحقق من الشرط أما ال while يتحقق من الشرط بعدين يدخل في اللوب اذا حقق الشرط
و بس نقرتين لعرض الصورة في صفحة مستقلة

 

mr_stock غير متواجد حالياً  
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 10-01-2011, 01:47 PM   #13

mr_stock

جامعي

 
تاريخ التسجيل: Jan 2011
التخصص: IS
نوع الدراسة: إنتظام
المستوى: السادس
الجنس: ذكر
المشاركات: 19
افتراضي رد: دروس خصوصيه في cpcs 202 cpcs 203 + حل بروجكتات

المشاركة الأصلية كتبت بواسطة الجرشي مشاهدة المشاركة
الله لا يهينك كيف أخلي هذا البرنامج لوب و لو أدخل المستخدم 0 أو خيار غير المحدد من 1-4 يكتب له خطا بدون ما يطبع أدخل الرقمين

الرجو الرد سريعا لا هنت

كود:
#include<stdio.h>
int main ()

{
	int num1, num2,i=0;
	char Char;
 
	printf("1:(+)\n 2:(-)\n 3:(*)\n 4:(/)\n 0: To Exit \n\n Enter a choice: ");
    scanf("%c",&Char);

	printf("Enter the first number: ");
	scanf("%d",&num1);

	printf("Enter the second number: ");
	scanf("%d",&num2);
	
	if(Char == '+' || Char == '1')
		printf(" %d + %d = %d",num1, num2, num1+num2);

		
	else if(Char == '-' || Char == '2')
		printf(" %d - %d = %d",num1, num2, num1-num2);
		
	

	else if(Char == '*' || Char == '3')
		printf(" %d * %d = %d",num1, num2, num1*num2);

		

	else if (Char == '/' || Char == '4')
		printf(" %d / %d = %d",num1, num2, num1/num2);


	else 
		printf("Error in choice \n");
	
 

	return(0);

}

تقدر تضيف else if و تحط شرطها انو يكون المدخل اقل من 1 و اكثر من 4 و يطبعلو error
يعني تحط هذا الشرط
else if (char>4 || char<1) // 1
printf ("error you enter num out of range 1-4")//2

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

 

mr_stock غير متواجد حالياً  
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 10-01-2011, 01:51 PM   #14

mr_stock

جامعي

 
تاريخ التسجيل: Jan 2011
التخصص: IS
نوع الدراسة: إنتظام
المستوى: السادس
الجنس: ذكر
المشاركات: 19
افتراضي رد: دروس خصوصيه في cpcs 202 cpcs 203 + حل بروجكتات

المشاركة الأصلية كتبت بواسطة hasooona مشاهدة المشاركة
بليز ممكن تفهمني الفكره وايش استخدم واذا عندك الحل اعطيني ياه وانا بفهمهنقرتين لعرض الصورة في صفحة مستقلة
بالنسبه للبروجكت هذا لازم تسويلو 3 كلاسات و تحط الاوامر المطلوبه في البرنامج لكل كلاس مثل ال set & get

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

 

mr_stock غير متواجد حالياً  
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 11-01-2011, 02:21 AM   #15

رغـــدهـ ~

جامعي

الصورة الرمزية رغـــدهـ ~

 
تاريخ التسجيل: Oct 2010
التخصص: حاسبات وتقنيه المعلومات
نوع الدراسة: إنتظام
المستوى: الرابع
الجنس: أنثى
المشاركات: 33
افتراضي رد: دروس خصوصيه في cpcs 202 cpcs 203 + حل بروجكتات

مررره شكرن
يعطيك العآفيه نقرتين لعرض الصورة في صفحة مستقلة

 

توقيع رغـــدهـ ~  

 

اذا نسمع بطاريكم نبوس حروف اساميكم نقرتين لعرض الصورة في صفحة مستقلة

 

رغـــدهـ ~ غير متواجد حالياً  
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 17-01-2011, 09:06 PM   #16

mr_stock

جامعي

 
تاريخ التسجيل: Jan 2011
التخصص: IS
نوع الدراسة: إنتظام
المستوى: السادس
الجنس: ذكر
المشاركات: 19
افتراضي رد: دروس خصوصيه في cpcs 202 cpcs 203 + حل بروجكتات

المشاركة الأصلية كتبت بواسطة رغـــدهـ ~ مشاهدة المشاركة
مررره شكرن
يعطيك العآفيه نقرتين لعرض الصورة في صفحة مستقلة
الله يعافيكي
لا شكر على واجب

 

mr_stock غير متواجد حالياً  
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 14-05-2013, 12:38 PM   #17

بنفسي اصنع سعادتي

جامعي

الصورة الرمزية بنفسي اصنع سعادتي

 
تاريخ التسجيل: Nov 2010
كلية: كلية الاقتصاد والادارة
التخصص: علوم إدارية
نوع الدراسة: إنتساب
المستوى: متخرج
البلد: جــــدة
الجنس: أنثى
المشاركات: 153
افتراضي رد: دروس خصوصيه في cpcs 202 cpcs 203 + حل بروجكتات

الله يسعدكككم ساعدوني في هالبورجيكت بوكرا عندي اختبار نهائي حاولت احلو بس م عرفت =(((

Project 5 Deion:
In this project, you will modify the Cargo Charges program you have written in Project 4 (See attached). You need to implement the following extensions:
Extension 5: The program should allow the user to make at least two shipments for each category. The charges of these shipments will be stored in arrays (e.g. array SaudiaCharges() will contain the charges for the shipments made for Saudi Arabia, . array GulfCharges() will contain the charges for the shipments made for Gulf and array OtherCountryCharges() will contain the charges for the shipments made for other countries).
Array Contents after the sample run 1:
SaudiaCharges() Array:



4275 5700 … … … … … …


GulfCharges() Array:




1308.15 3197.70 571.2 … … … … …





OtherCountryCharges() Array:




7481.25 1571.0625 … … … … … …

Then the relevant methods will find the maximum charges from all the charges for shipments made for Saudia, Gulf and other countries. For example, the method Saudia() will find the maximum charges from all the shipments made for Saudi Arabia, the method Gulf() will find the maximum charges from all the shipments made for Gulf and the method OtherCountries() will find the maximum charges from all the shipments made for other countries. Finally the program will display the maximum of these three charges.

Extension 1:If, the user entersS or s (for shipping in Saudi Arabia) ,G or g (for shipping to Gulf countries) , O or o (for shipping to other countries), the program should call the corresponding methods for performing all the previous tasks for these countries. For example, if the user enters S or s, the main() method should call a method Saudia(). In Saudia() method, the user will enter a value for cargo weight and the distance, and calculate the charges according to table 1 (as you did in project 3).
If the user enters G or g, the main() method should call a method Gulf(). In Gulf() method, the user will enter a value for cargo weight and the distance, and calculate the charges according to table 1 (as you did in project 3).
If the user enters ) O or o, the main() method should call a method OtherCountries(). In OtherCountries() method, the user will enter a value for cargo weight and the distance, and calculate the charges according to table 1 (as you did in project 3).
After each program run you need to ask the user if he wants to ship another cargo (using confirmation dialog of JOptionPane). If the user clicks YES, the program will continue and ask the user to input the new cargo details. This process continues until the user clicks NO.



Extension 2:
The program must keep a count of the number of shipments the user wants to ship and print the count number after the user clicks NO. For example, if the user has shipped the 4cargoes , then the program should print: "You have used the program 4 times".
Extension 3:The program should calculate and print the shipping charges and discount for each region (Saudi Arabia, Gulf countries and other countries) in the methods Saudia(), Gulf() and OtherCountires() respectively, after each cargo shipment .
At the end the program will print the total charge for all cargoes by using the method TotalCharges() which will return the total charges for all cargoes to main() method where it will be displayed.
Extension 4: The program will terminate only if two valid shipments for any of the category (i.e. Saudia, Gulf or Other countries) is made. Otherwise, it will continue to run (asking the user for input and repeating the whole program from extension 1).














Attachment: (Project 4)
Project 2 Deion:
A Shipping Company charges cargoes in Saudi Arabia based on the following rates :

Weight of the Cargo (in KG) Shipping Rate per KM
2 kg or less SR 0.25
Over 2 kg, but not more than 10 kg SR 0.2
Over 10 kg, but not more than 20 kg SR 0.15
Over 20 kg, but not more than 50 kg SR 0.2
table 1
Shipping charges for the Gulf countries costs 2% more and 5% more for other countries.
write a Java program that allows the user to enter the weight of the cargo , the place and
the distance it is to be shipped(Saudi Arabia, Gulf country or other) and then displays the charges.

Input validation:
The user has to enter S (for shipping in Saudi Arabia) ,G (for shipping to Gulf countries) , O (for shipping to other countries). Next, the user will enter a value cargo weight and the distance . The program will calculate the charges according to table 1. The output of the program should be the shipping charges. In addition, consider the following scenarios in the output:
1. If the user inputs a character that is not recognized (NOT S, G, orO), then the program prints “Wrong Selection!”, and exits.
2. If the user inputs 0 or less for the value of the cargo weight , the program will display a message that states “the weight must be larger than Zero!”
3. The maximum weight the companywill ship is 50 KG, So if the user enter more than 50 KG, the program will display “the weight must not exceed 50KG!”
4. These are the company’s minimum and maximum shipping distances. So your program should not accept distances of less than 10 Km or more than 5000 KM. Display an appropriate message to the user if entered unaccepted distance.
5. After displaying the shipping charge,the program should also display the discount for the charges value according to the following rules:
a. If charges value is less than or equalSR 1000, print “Discount is 0 %.”
b. If charges value is less than 10000, print “Discount is 5%.”
c. If charges value is greater than or equal 10000, print “Discount is 10%.”


Project 3 Deion:
In this project, you will modify the Cargo Charges program you have written in Project 2 (See attached). You need to implement the following extensions:
Extension 1: After each program run you need to ask the user if he wants to ship another cargo (using confirmation dialog of JOptionPane). If the user clicks YES, the program will continue and ask the user to input the new cargo details. This process continues until the user clicks NO.
Extension 2:The program must keep a count of the number of shipments the user want to ship and print the count number after the user clicks NO. For example, if the user has shipped the 4cargoes , then the program should print: "You have used the program 4 times".
Extension 3:The program should calculate and print the shipping charges and discount for each region (Saudi Arabia, Gulf countries and other countries) after each cargo shipment . At the end the program will print the total charge for all cargoes.
Extension 4: The program will terminate only if one valid shipment is made. Otherwise, it will continue to run (asking the user for input and repeating the whole program from extension 1).














Sample Output
The program should display a Menu for the user to choose from. The menu is shown in the figure below.

Welcome to Shipping System
Press S for shipping in Saudi Arabia
Press G for shipping to Gulf countries
Press O for shipping to other countries

Note: Submit only the source code. For example: IA_1110348_P2.java
Sample Program Run #1:

Welcome to Shipping System

Press S for shipping in Saudi Arabia
Press G for shipping to Gulf countries
Press O for shipping to other countries

G
Make shipment for Gulf:
Enter a value for the cargo weight:20
Enter a value for the distance: 450

Discount is 5%

The Charge ofYour20KG Cargo will be 1308.15 SR.





Make another shipment for Gulf:
Enter a value for the cargo weight:30
Enter a value for the distance: 550

Discount is 5%

The Charge ofYour30KG Cargo will be 3197.7 SR.




Welcome to Shipping System

Press S for shipping in Saudi Arabia
Press G for shipping to Gulf countries
Press O for shipping to other countries

G

Enter a value for the cargo weight:8
Enter a value for the distance: 350

Discount is 0%

The Charge ofYour8KG Cargo will be 571.2 SR.





Welcome to Shipping System

Press S for shipping in Saudi Arabia
Press G for shipping to Gulf countries
Press O for shipping to other countries

S
Make shipment for Saudi Arabia:
Enter a value for the cargo weight:45
Enter a value for the distance: 500

Discount is 5%

The Charge ofYour45KG Cargo will be 4275 SR.


Make another shipment for Saudi Arabia:
Enter a value for the cargo weight:50
Enter a value for the distance: 600

Discount is 5%

The Charge ofYour50KG Cargo will be 5700 SR.












Welcome to Shipping System

Press S for shipping in Saudi Arabia
Press G for shipping to Gulf countries
Press O for shipping to other countries

O
Make shipment for Other countries:

Enter a value for the cargo weight:50
Enter a value for the distance: 750

Discount is 5%

The Charge ofYour50KG Cargo will be 7481.25 SR.


Make another shipment for Other countries:

Enter a value for the cargo weightنقرتين لعرض الصورة في صفحة مستقلة
Enter a value for the distance: 700

Discount is 5%

The Charge ofYour15KG Cargo will be 1571.0625 SR.







User selects “No”
Output:
"You have used the program 7 times"
Total Charges for all cargoes = 24104.3625 SR
Total Charges for Saudi Arabia = 9975 SR
Total Charges for Gulf = 5077.05 SR
Total Charges for Other Countries = 9052.3125 SR
Maximum charges for Saudi = 5700 SR
Maximum charges for Gulf = 3197.70 SR
Maximum charges for Other countries = 7481.25 SR
Maximum of all the charges = 7481.25
Sample Program Run #2:
Welcome to Shipping System

Press S for shipping in Saudi Arabia
Press G for shipping to Gulf countries
Press O for shipping to other countries

Z
Wrong Selection!
Enter valid option.








Welcome to Shipping System

Press S for shipping in Saudi Arabia
Press G for shipping to Gulf countries
Press O for shipping to other countries

O

Make shipment for Other countries:

Enter a value for the cargo weightنقرتين لعرض الصورة في صفحة مستقلة
Enter a value for the distance: 2550

Discount is 5%

The Charge ofYour15KG Cargo will be 5723.15625 SR.

Make another shipment for Other countries:

Enter a value for the cargo weight:45
Enter a value for the distance: 2000

Discount is 5%

The Charge ofYour45KG Cargo will be 17955 SR.
















Welcome to Shipping System

Press S for shipping in Saudi Arabia
Press G for shipping to Gulf countries
Press O for shipping to other countries

S
Enter shipment for Saudi Arabia:
Enter a value for the cargo weight:2
Enter a value for the distance: 150

Discount is 0%

The Charge ofYour2KG Cargo will be 75 SR.

Enter another shipment for Saudi Arabia:
Enter a value for the cargo weight:30
Enter a value for the distance: 50

Discount is 0%

The Charge ofYour30 KG Cargo will be 300 SR.















Welcome to Shipping System

Press S for shipping in Saudi Arabia
Press G for shipping to Gulf countries
Press O for shipping to other countries

G

Make shipment for Gulf:

Enter a value for the cargo weight:25
Enter a value for the distance: 1000

Discount is 5%

The Charge ofYour25KG Cargo will be 4987.5 SR.









Make another shipment for Gulf:

Enter a value for the cargo weight:50
Enter a value for the distance: 500

Discount is 5%

The Charge ofYour50KG Cargo will be 4987.5 SR.




User selects “No”
Output:
"You have used the program 6 times"
Total Charges for all cargoes = 34028.15625 SR
Total Charges for Saudi Arabia =375 SR
Total Charges for Gulf = 9975 SR
Total Charges for Other Countries = 23678.15625 SR
Maximum charges for Saudi = 300 SR
Maximum charges for Gulf = 4987.5 SR
Maximum charges for Other countries = 5723.15625 SR
Maximum of all the charges = 5723.15625









Sample Program Run #3:
Welcome to Shipping System

Press S for shipping in Saudi Arabia
Press G for shipping to Gulfcountries
Press O for shipping to other countries

O
Make shipment for other country:

Enter a value for the cargo weight:60
the weight must not exceed 50KG!

Enter valid option.


Welcome to Shipping System

Press S for shipping in Saudi Arabia
Press G for shipping to Gulf countries
Press O for shipping to other countries

…………………………

 

بنفسي اصنع سعادتي غير متواجد حالياً  
 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 20-05-2013, 09:08 PM   #18

nour al3mr

الصورة الرمزية nour al3mr

 
تاريخ التسجيل: Jun 2008
كلية: كلية الآداب والعلوم الانسانية
التخصص: English Language
نوع الدراسة: متخرج - انتظام
المستوى: متخرج
البلد: جــــدة
الجنس: أنثى
المشاركات: 52,226
افتراضي رد: دروس خصوصيه في cpcs 202 cpcs 203 + حل بروجكتات

موضوع قديم
يُغلق .

 

توقيع nour al3mr  

 

::

:: سيظل أبي حُباً يَحْكيه دُعآئي دائماً ..
ربـآهـ لا تحرم أبي من جنة الفردوس ,, فَـ هو لم يحرمني شيئاً في الدُنيـآ ::

|| السبت 5/5/2012 - 14/6/1433 هـ || يوم فقدهـ ..


::
والدة أختنا المستشارة white rose | في ذمة الله

::


جعل الله مثواك الجنة اختنا صالحة Conscientious
::

~..اللـهُـــم ارْزُقنَـــا الأُنْسَ بِقُرْبِكْـ و اجرنا منْ النَـآرْ..~

 

nour al3mr غير متواجد حالياً  
 

موضوع مغلق

أدوات الموضوع إبحث في الموضوع
إبحث في الموضوع:

البحث المتقدم
انواع عرض الموضوع

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

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

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

 


الساعة الآن 08:04 AM


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