Question

In: Computer Science

Input, output, and math Draw a diagram for a program that: 1. Creates a variable called...

Input, output, and math
Draw a diagram for a program that:
1. Creates a variable called tspBakingSoda, stores 1 in it.
2. Creates a variable called tspBakingPowder, stores 0.5 in it.
3. Creates a variable called cupsButter, stores 1 in it.
4. Creates a variable called cupsWhiteSugar, stores 1.5 in it.
5. Creates a variable called totalEggs, stores 1 in it.
6. Ask the user "how many batches?",
store in a variable called batches.
7. Multiply tspBakingSoda by batches
8. Multiply tspBakingPowder by batches
9. Multiply cupsButter by batches
10. Multiply cupsWhiteSugar by batches
11. Multiply totalEggs by batches
12. Display text, "Cookie recipe"
13. Display tspBakingSoda
14. Display tspBakingPowder
15. Display cupsButter
16. Display cupsWhiteSugar
17. Display totalEggs

Solutions

Expert Solution

Answer: Hello! Find your diagram for this program. I design this diagram in which steps you gave in question. First created and initialized all variables and then enter batches store it to a variable. Multiplication of batches with all variables one by one and store their value to each respective variable. Then display all variables one by one. Thanks.


Related Solutions

3A. Draw a diagram of a heat engine and label (a) heat input, (b) heat output,...
3A. Draw a diagram of a heat engine and label (a) heat input, (b) heat output, and (c) work output. B. Draw a diagram for the outcomes of flipping four coins and label them with the probability of obtaining each macrostate.
Need a program in java that creates a random addition math quiz The program should ask...
Need a program in java that creates a random addition math quiz The program should ask the user to enter the following The smallest and largest positive numbers to be used when generating the questions - The total number of questions to be generated per quiz - The total number of the quiz's to create from then the program should generate a random math (Just addition) quiz from what the user entered
Draw the schematic diagram of circuit which realizes function F=x'y'z+xz by using 3 input active-0 output...
Draw the schematic diagram of circuit which realizes function F=x'y'z+xz by using 3 input active-0 output DECODER and necessary AND, OR, EXOR and NOT gates.
Consider the dataset between a quantitative input variable, ? and a quantitative response (output) variable, ?...
Consider the dataset between a quantitative input variable, ? and a quantitative response (output) variable, ? . Which of the following provides an optimal fit between them - a linear model, a complete quadratic model or a complete third order model? (Hint: You can use adjusted multiple coefficient of determination, ?2 to determine the optimal? model. Your answers below must be accompanied by appropriate computation in Excel)?2 value for the linear model = ________________ ?2 value for the quadratic model...
java program: Input and output the following details. Your program can only receive the correct input....
java program: Input and output the following details. Your program can only receive the correct input. (For example: a notification will be given if you not enter Char data type for Name) Name: Ali bin Ahmad Occupation: Technician Age: 30 Hometown: Negeri Sembilan Years of Service: 12 Gender: Male
1. Draw a simple circuit diagram of half wave specific with sinusoidal input signal define on...
1. Draw a simple circuit diagram of half wave specific with sinusoidal input signal define on V_in (t) = A*cos(wt^2*pi*f) with peak voltage of 10 V and frequency of 60 Hz. 2. Design the output voltage in terms of fourier transform. 3. Use matlab to plot the frequency spectrum of the rectified signal for magnitude and phase use load resistance as 1 kilo-ohm and cutoff frequency as 10 Hz. 4. Design a second order butterworth filter of a specific cosine...
Draw a simple diagram and include detailed labels that shows: the two ways that meiosis creates...
Draw a simple diagram and include detailed labels that shows: the two ways that meiosis creates genetic diversity (crossing over and independent assortment) You should draw chromosomes (complete with chromosome # and maternal/paternal symbol), and you might label them with different alleles. You will need two drawings each accompanied by a few sentences worth of text.
Create a program “Fib.java” and a method called “double[] getFib)” that creates an array with a...
Create a program “Fib.java” and a method called “double[] getFib)” that creates an array with a length of 15 that contains the first 15 numbers in the Fibonacci sequence and returns it. Set the first element to 0 and the second element to 1, then use a for loop to fill out the rest of the array.
A)Draw and clearly label a diagram that shows the level of output at which a monopoly...
A)Draw and clearly label a diagram that shows the level of output at which a monopoly maximises profits. Show the monopoly price and level of profits made by your monopoly firm. explain the key features of your diagram. B)Refer to the diagram you drew for part (a). How is this situation similar to that of a competitive market? How is it different? Explain the reason(s) for each of the differences you note. Hint: list and explain as many similarities and...
Question 3 (a) Draw and clearly label a diagram that shows the level of output at...
Question 3 (a) Draw and clearly label a diagram that shows the level of output at which a monopoly maximises profits. Show the monopoly price and level of profits made by your monopoly firm. Use 2 or 3 sentences to explain the key features of your diagram. (b) Refer to the diagram you drew for part (a). How is this situation similar to that of a competitive market? How is it different? Explain the reason(s) for each of the differences...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT