c++简单作业·明天交·帮帮我

4. Give meaningful identifiers for the following variables. (a) A variable to store the first name of a student. (b) A variable to store the discounted price of an item. (c) A variable to store the number of juice bottles. (d) A variable to store the number of miles traveled. (e) A variable to store the highest test score.5. Consider the following program segment //include statement(s) //using namespace statement int main() { //variable declaration //executable statements //return statement }(a) Write C++ statements that include the header files iostream. (b) Write a C++ statement that allows you to use cin, cout, and endl without the prefix std::. (c) Write C++ statements that declare the following variables num1, num2, num3, and average of type int. (d) Write C++ statements that store 125 into num1, 28 into num2, and -25 into num3. (e) Write a C++ statement that scores the average of num1, num2, and num3, into average. (f) Write C++ statements that output the values of num1, num2, num3, and average. (g) Compile and run your program
2026年09月23日 06:27
有3个网友回答
网友(1):

4.
a. string FirstName
b. double DiscountPrice
c. int BottleCount
d. int TracedMiles
e. int HighestScore

5.
a. #include
b. using namespace std;
c. int num1;
int num2;
int num3
int average;
d. num1 = 125;
num2 = 28;
num3 = -25;
e. average = (num1 + num2 + num3) / 3;
f. cout << "num1:" << num1 << \n"num2:"
<< num2 << "\nnum3:" << num3 <<"\navarege:" << avarege << endl;

答案很好 怎么不采纳呢

网友(2):

4.
a. string FirstName
b. double DiscountPrice
c. int BottleCount
d. int TracedMiles
e. int HighestScore

5.
a. #include
b. using namespace std;
c. int num1;
int num2;
int num3
int average;
d. num1 = 125;
num2 = 28;
num3 = -25;
e. average = (num1 + num2 + num3) / 3;
f. cout << "num1:" << num1 << \n"num2:"
<< num2 << "\nnum3:" << num3 <<"\navarege:" << avarege << endl;

网友(3):

直接写例子就行了么??会不会太简单了……,要不你下个hi百度,咱俩聊聊