InstagramTwitterSnapChat


 
وصف

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


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

c++ وماادراك ما c++ ارجو المساعده ان امكن

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

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

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

جامعي

 
تاريخ التسجيل: Apr 2010
التخصص: IS
نوع الدراسة: إنتظام
المستوى: الثالث
الجنس: ذكر
المشاركات: 3
افتراضي c++ وماادراك ما c++ ارجو المساعده ان امكن


Q1: What is the difference between the following two statements:

1. if (n > 2) { if (n < 6) cout << “OK”; } else cout << “NG”;

2. if (n > 2) { if (n < 6) cout << “OK”; else cout << “NG” };

------------------------
Q2: Use switch statement to rewrite the following code segment:

if (num == 1)
{cout << “Alpha”; }
else if (num == 2)
{ cout << “Beta”; }
else if (num == 3)
{ cout << “Gamma”; }
else
{ cout << “Other”; }
--------------------------
Q3: A palindrome is a number or a phrase that reads the same backwards as
forwards. For example, each of the following five-digit integers is a palindrome:
12321, 55555, 45554 and 11611. Write a program that reads in a five-digit integer
and determines whether it is a palindrome.

-----------------------
Q4: Write a program that reads three nonzero integers and determines and prints
whether they could be the sides of a right triangle
.
----------------------
Q5: Write and run a program –using nested if- that plays the game of "rock, paper,
scissors.”

The rules are:
1. Paper dominates (wraps) rock
2. Rock dominates (breaks) scissors
3. Scissors dominate (cut) paper

Hints:
• The program must clear the screen after the first player makes his/her choice; the
second player should not know his/her choice.
• The program must clear the screen after the second player makes his/her choice,
and then print the result.

Output samples:

Try 1:

* Welcome to "rock, paper, scissors.” Game *

st
1 Player
Please enter your first name: Abdullah

Choose rock (0), paper (1), or scissors (2):

Abdullah: 1
* Welcome to "rock, paper, scissors.” Game *

nd
2 Player
Please enter your first name: Ahmad

Choose rock (0), paper (1), or scissors (2):

Ahmad: 0

Abdullah chose paper
Ahmad chose rock
########## Abdullah WINS ##########
------------------------------------------
6-Write and run a program that print the following table:
Monthly Sales Income
--------------------------------------------------------------------------------------------------------------------
Greater than or equal to $50,000 $375 plus 16% of sales
Less than $50,000 but greater than or equal to $40,000 $350 plus 14% of sales
Less than $40,000 but greater than or equal to $30,000 $325 plus 12% of sales
Less than $30,000 but greater than or equal to $20,000 $300 plus 9% of sales
Less than $20,000 but greater than or equal to $10,000 $250 plus 5% of sales
Less than $10,000 $200 plus 3% of sales

Then calculates the monthly income of a computer salesperson using the following
commission schedule:

Monthly Sales Income
--------------------------------------------------------------------------------------------------------------------
Greater than or equal to $50,000 $375 plus 16% of sales
Less than $50,000 but greater than or equal to $40,000 $350 plus 14% of sales
Less than $40,000 but greater than or equal to $30,000 $325 plus 12% of sales
Less than $30,000 but greater than or equal to $20,000 $300 plus 9% of sales
Less than $20,000 but greater than or equal to $10,000 $250 plus 5% of sales
Less than $10,000 $200 plus 3% of sales
--------------------------------------------------------------------------------------------------------------------
Enter the value of monthly sales: 36243.89
The income is $4674.27
رد مع اقتباس

 

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 04-04-2010, 06:37 PM   #2

wsadw

جامعي

 
تاريخ التسجيل: Apr 2010
التخصص: IS
نوع الدراسة: إنتظام
المستوى: الثالث
الجنس: ذكر
المشاركات: 3
افتراضي رد: c++ وماادراك ما c++ ارجو المساعده ان امكن

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

 

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

منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 05-04-2010, 12:56 AM   #3

رفاء110

جامعي

 
تاريخ التسجيل: Apr 2009
نوع الدراسة: إنتظام
المستوى: الثامن
الجنس: أنثى
المشاركات: 20
افتراضي رد: c++ وماادراك ما c++ ارجو المساعده ان امكن

هذي حل السؤالين الأولى:


Q1: What is the difference between the following two statements:

1. if (n > 2) { if (n < 6) cout << “OK”; } else cout << “NG”;

2. if (n > 2) { if (n < 6) cout << “OK”; else cout << “NG” };

------------------------
الخيار الأول else تابعة لـ If الأولى وif الثانية اللي بين قوسين كبيرة برضها تابعة للـ if الأولى بس مالها علاقة ب else
الخيار الثاني else تابعة لـ if الثانيــــــة واللي هي بدورها تابعة لكلمة if الأولى يعني ما راح تتطبق إلا لما ينطبق شرط أول if ويختل شرط ثاني if

يعني مثلاً إذا دخلت 1

الخيار الأول :ما راح يدخل على if فيروح المعالج على طول على else ويكتب لي NG

الخيار الثاني : ماراح يدخل على أول if ,, وعشان if الثانية هي وelse من ضمن الستيتمنت حقتها ف اختل الشرط من البداية وما راح يكتب لي شيء.



-------------------------------------
Q2: Use switch statement to rewrite the following code segment:

if (num == 1)
{cout << “Alpha”; }
else if (num == 2)
{ cout << “Beta”; }
else if (num == 3)
{ cout << “Gamma”; }
else
{ cout << “Other”; }

الجواب:

switch(num)
case 1: cout<<"Alpha"; break;
case 2 : cout<<"Beta"; break;
case 3 : cout<<"Gamma" ; break;
default: cout<<"Other" ;
break;

هذا اللي خطر على بالي عالسريع

بالتوفيق

 

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

إضافة رد


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

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

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

 


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