عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
قديم 23-10-2010, 07:27 PM   #10

حياتك لوحتك ارسمهابطريقتك

جامعي

 
تاريخ التسجيل: Jul 2010
التخصص: تقنية معلومات
نوع الدراسة: إنتظام
المستوى: الثالث
الجنس: أنثى
المشاركات: 20
افتراضي رد: [cpcs 202 - برمجة 1] لديك سؤال , شيء غير مفهوم ,,, تفضل هنا , موضوع مفيد

مستر احمد ممكن تحليلي دي البرامج بعضها ابغى اتاكد وبعضها ماعرفت لها...
2- Write a program that enter 2 integers, and display the result of each next mathematical processes (+ , - , * , \ , %) for the 2 variable’s in one printf command.
Hint : you may need convert the input to (double) to do the division.


3- Your summer surveying job requires you to study some maps that give distances in kilometers and some that use miles. You and your coworkers prefer to deal in metric measurements. Write a program that performs the necessary conversion.
 Each miles equal to 1.609 kilometer.
 Hint :

/* Converts distances from miles to kilometers. */

#include <stdio.h> /* printf, scanf definitions */
#define KMS_PER_MILE 1.609 /* conversion constant */

int main(void)
{
double miles, /* distance in miles */
kms; /* equivalent distance in kilometers */

/* 1. Get the number of miles from the user */

/* 2. Convert miles to kilometers */

/* 3. Display the number of kilometers */

return (0);
}


4- Write a program display the volume of cone ?
V= 1/3 µ r2 h
µ=3.14
r =radius
h =height

Hint:






5- What are the program output and show memory trace :

a- #include <stdio.h>
#include <conio.h>
void main( )
{
int x=0,y=15,z=-22,g;
z++;
g=x-- + z;
--y;
x+=y;
printf("x=%d\ny=%d\nz=%d\ng=%d",x,y,z,g);
getch();
}




Output Screen & memory:















b- #include <stdio.h>
#include <conio.h>
void main( )
{
int x;
x = 2%2+2*2-2/2;
printf("\nthe value of x= %d",x);
x = (3 * 9 *(3 + (9 * 3 / 3)));
printf("\nthe value of x=%d ",x);

getch();
}

Output Screen & memory:















6- Write a program that will read a number from user and tests if it’s modules 2 is equal zero, writes a message ?
Hint:



7- Calculate and display the area of a circle and the circumference.
Area of circle = 3.14 * r2
Circumference = 3.14 * 2 * r
hint :
where r is the radius.

8- Write a program that convert a test score into equivalent letter grade

Notes:
• The equivalent letter grade Table:

100 – 90 A
89 – 80 B
79 – 70 C
69 – 60 D
59 – 0 F
else out of rang

 

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