Question: c++ 1. (10%) Write a program to fulfill all of the following requirements: It does not accept any input. It uses the 8 digits of

c++ c++ 1. (10%) Write a program to fulfill all of the following

1. (10%) Write a program to fulfill all of the following requirements: It does not accept any input. It uses the 8 digits of your student number to initialize 8 variables of type int, one for each variable. It prints 10 lines such that each line displays an expression that only uses these 8 variables (without the use of any constants) and the following four operators (i.e., +, - *, *) to compute a single-digit result (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, 9) followed by the equal sign (=) and the single-digit value thus computed. Each of your expression in your program may use the same variables as many times as you like and/or the same operators as many times as you like. Note that the divide-operator (i.e., ) is not allowed to be used It prints these 10 lines so that a line with smaller single-digit result is printed before a line with larger single-digit result i.e., the resulting single-digits in each line (the numbers on the right side of the equal sign =") should be in an ascending order from 0 to 9. Two samples are listed below: Code Sample 1 /* Define the 8 variables as follow in this program. */ /* For example, my Student Number is 50769206, the following 8 statements are included in this program. */ Sample 2 / For example, my Student Number is 53534460, the following 8 statements are included in this program. / int sl - 5; int s2 = 0; int s3 - 7; int 34 - 6; int s5 = 9; int 56 - 2; int 37 = 0; int s8 - 6; int sl = 5; int s2 = 3; int 53 - 5; int 34 = 3; int 35 4; int 36 - 4; int s7 = 6; int s8 - 0; Console Output My student number - 50769206 The result: s2 = 0 33 - 34 - 1 $6 = 2 s5 - S4 = 3 34 - 36 4 sl = 5 34 = 6 53 - 7 36 + 388 35 = 9 My student number - 53534460 The result: 38 = 0 s5 - 54 - sl - s2 = 2 s4 = 3 s5 - 4 S3 = 5 S7 = 6 S4 + s5 = 7 35 + 86-8 s2 + 7 = 9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!