(Practice) Write a for statement for each of the following cases:
a. Use a counter named i that has an initial value of 1, a final value of 20, and an increment of 1.
b. Use a counter named icount that has an initial value of 1, a final value of 20, and an increment of 2.
c. Use a counter named j that has an initial value of 1, a final value of 100, and an increment of 5.
d. Use a counter named icount that has an initial value of 20, a final value of 1, and an increment of -1.
e. Use a counter named icount that has an initial value of 20, a final value of 1, and an increment of -2.
f. Use a counter named count that has an initial value of 1.0, a final value of 16.2, and an increment of 0.2.
g. Use a counter named xcnt that has an initial value of 20.0, a final value of 10.0, and an increment of -0.5.
Trending nowThis is a popular solution!
Chapter 5 Solutions
C++ for Engineers and Scientists
- Please provide me a machine problem one for each of these belowarrow_forward(Practice) State whether the following variable names are valid. If they are invalid, state the reason. prod_a c1234 abcd _c3 12345 newamp watts $total new$al a1b2c3d4 9ab6 sum.of average volts1 finvoltarrow_forward8 In the following code, use the dropdowns select the correct values of the register al at different points during the program. (Note: ignore the extra spaces inside of the brackets, they have to be there for the dropdowns to work correctly) .databyteArray BYTE 1, 2, 3, 4, 5, 6.codemov esi, OFFSET byteArrayadd esi, 3mov al, [esi ] ; al = ????Answer??????sub esi, 2mov al, [esi ] ; al = ???Answer??????? 9arrow_forward
- write about Heron’s formula ?arrow_forward(General math) The volume of oil stored in an underground 200-foot deep cylindrical tank is determined by measuring the distance from the top of the tank to the surface of the oil. Knowing this distance and the radius of the tank, the volume of oil in the tank can be determined by using this formula: volume=radius2(200distance) Using this information, write, compile, and run a C++ program that accepts the radius and distance measurements, calculates the volume of oil in the tank, and displays the two input values and the calculated volume. Verify the results of your program by doing a hand calculation using the following test data: radius=10feetanddistance=12feet.arrow_forwardPlease try to do in 20 mintsarrow_forward
- For the following code, match the outcome if x =:arrow_forwardrefer to image below. Draw the block diagram for function f(a, b, c) given in the following truth table. Only use 4-IN MUX to implement the function. Make sure you label all input, control, and output lines.arrow_forward(Electrical eng.) a. Write, compile, and run a C++ program that calculates and displays the value of the current flowing through an RC circuit (see Figure 3.19). The circuit consists of a battery connected in a series to a switch, a resistor, and a capacitor. When the switch is closed, the current, i, flowing through the circuit is given by this formula: i=(EIR)et/RC Eisthevoltageofthebatteryinvolts.Risthevalueoftheresistorinohms.Cisthevalueofthecapacitorinfarads.tisthetimeinsecondsaftertheswitchisclosed.eisEulersnumber,whichis2.71828( roundedtofivedecimalplaces). Using this formula, write, compile, and run a C++ program to determine the voltage across the capacitor shown in Figure 3.19 when t is 0.31 seconds. (Note: The value of RC is referred to as the system’s time constant.) The program should prompt the user to enter appropriate values and use input statements to accept the data. In constructing the prompts, use statements such as “Enter the voltage of the battery.” Verify your program’s operation by calculating by hand the current for the following test data: Testdataset1:Voltage=20volts,R=10ohms,RC=0.044,t=0.023secondsTestdataset2:Voltage=35volts,R=10ohms,RC=0.16,t=0.067seconds b. Check the value computed by your program by hand. After verifying that your program is working correctly, use it to complete the following chart:arrow_forward
- -Please I need a complete code -Inline assembly code with c -Please using 16 bit register -important note(The reading and printing should be done in C and the rest of the code in assembly.) Show the test cases in visual stadio Q1.Write an inline assembly code to calculate the factorial of an integer called (A), and print the result. The value of A must be entered by the user. The reading and printing should be done in C and the rest of the code in assembly.arrow_forwardAlso test the function in mainarrow_forward- Simplify the following Boolean function using K-map ? F(X,Y,Z)=∏M(0,1,2,4) -The given Boolean function is in product of sum form. 1-Find the simplified Boolean function ? 2- Design the logic gate circuit of output function in Proteus and Tinkercad ? 3- Verify the truth table of output function in your circuit ?arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr