المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : ارجو المساعدة في برنامج c++ برنامج هوممورك وقرب التسليم


راعي الديابلو
22-10-2008, 04:40 PM
اخواني خبراء لغة c++ عندي برنامج c++ بالجامعة هومورك والتسليم قرب اتمنى منك تعطوني حله واشكركمتفضله البرنامج



Description: The student ask to write a complete program using C-language, the
Program consists of a set of functions as follow.
When you run the program, the following start menu should appear:


M- Math Functions.
F- Format.
C- Convert.
H- Summation of values stored in an array.
X- Exit.

What is your choice? ____


Start menu tasks description: - the following 1 through 6 gives the description of each choice from the start menu above.
1. If you press (M), sub menu should appear that including 5 functions as
follows:

1. Factorial.
2. Power.
3. Prime.
4. Odd or even.
5. No. of devisors.

What is your choice? ____

For example, if you press (1), you will enter a number you want to get it's factorial, etc…

2. If you press (F), sub menu should appear including two choices:


1. Enter seconds as an input, the format: HH:MM:SS will be output.
2. Enter days as an input, the format: YY:MM:DD will be output.

What is your choice? ____


For example, if you press (1) and enter (65 as no. of seconds ), the output will be: (005), etc…
3. If you press (C), sub menu should appear including three choices:

1. Enter capital letter: the *****alent small letter will be output.
2. Enter Temperature in Fahrenheit unit, the *****alent Celsius unit will be
output.
3. Enter length in Cm, the *****alent in Inch will be output.

What is your choice? ____


In previous tasks you must use logical operators and while or do-while loops.
4. If you press (H), sub menu should appear including two choices:

1. Arrays of float.
2. Arrays of Int.
What is your choice?____

These tasks require from you to declare and initialize two arrays of int, and two arrays of float previously in your program, and then if you press (1), you have to enter the values of two float arrays, and the summation of them will be the output, etc…
And you must perform the previous tasks using for loop, if statement, and/or operators.
5. If you press (X), the run of program will be ended.

CoDe.NeT
23-10-2008, 02:05 AM
عملت لك جزء من البرنامج والبقية عليك,, المهم تفهم الكود



#include <iostream>

#include <iomanip>


using namespace std;


void main()


{
cout<< "M- Math Functions\n" << "F- Format\n"<< "C- Convert\n";
cout <<"H- Summation of values stored in an array\n" << "X- Exit\n \n";


char inpt;



cin>>inpt;


///////////////////////////// M ////////////////////////////////////////////////
if( inpt == 'M')


{
cout<< "1. Factorial.\n" << "2. Power.\n"<<"3. Prime.\n"<< "4. Odd or even.\n"<< "5. No. of devisors.\n\n";

cout<< "\n For Example: if you press (1), you will enter a number you want to get it's factorial\n";


char secondinput ;



cin >> secondinput;

///---------------------------
if (secondinput == '1')


{
cout << "Enter the number to calculate its factorial \n";
double numb1, out1;


cin >> numb1;
// هنا توضع دالة حساب الفاكتوريال
// على سبيل المثال
// out1 = factorial( numb1);
//cout << "result is " << out1;
}
///----------------------------

///*****************************
if (secondinput == '2')


{
cout << "Enter the number to calculate it's power \n";


double numb2,pow, out2;



cin >> numb2;
cout << "\n Enter the power \n";
cin >> pow;
// هنا توضع دالة حساب القوة
// out2 = power( numb2,pow);
//cout << "result is " << out2;
}
////******************************


}


//////////////////////////////////////////////////////////////////////////////////////


if ( inpt == 'F')
{
cout<< "F\n";
}


if ( inpt == 'C')
{
cout<< "C\n";
}
if ( inpt == 'H')
{
cout<< "H\n";
}
if ( inpt == 'X')
{
cout<< "X\n";
}


system("pause");
}