1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Anit [1.1K]
2 years ago
9

java Consider the following problem statement. A cookie recipe calls for the following ingredients: 1.5 cups of sugar 1 cup of b

utter 2.75 cups of flour The recipe produces 48 cookies with this amount of the ingredients. Write a program that asks the user how many cookies he or she wants to make, and then displays the number of cups of each ingredient needed for the specified number of cookies. Format your output nicely that all numbers and decimals align as shown in the example! Limit decimals to four digits.
Computers and Technology
1 answer:
Veronika [31]2 years ago
4 0

Answer:

Explanation:

The following code is written in Java. It creates a program that asks the user how many cookies they want to make. Then it adjusts the original recipe based on the ratio of the original amount of cookies it makes to the amount the user wants. Finally, passing the output of the new adjusted recipe to the user. Due to technical difficulties, I have added the code as a txt file attached below.

You might be interested in
So I was wondering how I should get into Game Development?
Hunter-Best [27]
Tbh i depends on what kind of person you are. If you really like video games then go ahead but i guess what you are asking is how and that really doesnt answr your question but 
1) YOU HAVE TO BE FULLY COMMITTED/ MOTIVATED TO THE GAME
that is the number 1 step.Also try to do a little research on the game and the systems, watch videos on how to take the system apart and back together.
I HAVE FAITH IN YOU!!!  YOU CAN DO IT!!! TAKE CHARGE

8 0
3 years ago
What is the CPI of the central processing unit cpu of a computer
vlada-n [284]
Electronic component on a computer's
motherboard that interprets and carries
out the basic instructions that operate
the computer; also called processor.
5 0
2 years ago
"Write an iterative function iterPower(base, exp) that calculates the exponential baseexp by simply using successive multiplicat
sp2606 [1]

Answer:

I am writing the function using Python. Let me know if you want the program in some other programming language.            

def iterPower(base, exp):    

    baseexp = 1

    while exp > 0:

        baseexp = baseexp*base

        exp= exp - 1

    return baseexp

base = 3

exp = 2

print(iterPower(base, exp))

Explanation:

  • The function name is iterPower which takes two parameters base and exp. base variable here is the number which is being multiplied and this number is multiplied exponential times which is specified in exp variable.
  • baseexp is a variable that stores the result and then returns the result of successive multiplication.
  • while loop body keeps executing until the value of exp is greater than 0. So it will keep doing successive multiplication of the base, exp times until value of exp becomes 0.
  • The baseexp keeps storing the multiplication of the base and exp keeps decrements by 1 at each iteration until it becomes 0 which will break the loop and the result of successive multiplication stored in baseexp will be displayed in the output.
  • Here we gave the value of 3 to base and 2 to exp and then print(iterPower(base, exp)) statement calls the iterPower function which calculates the exponential of these given values.
  • Lets see how each iteration works:
  • 1st iteration

baseexp = 1

exp>0 True because exp=2 which is greater than 0

baseexp = baseexp*base

               = 1*3 = 3

So baseexp = 3

exp = exp - 1

      = 2 - 1 = 1    

exp = 1

  • 2nd iteration

baseexp = 3

exp>0 True because exp=1 which is greater than 0

baseexp = baseexp*base

               = 3*3 = 9

So baseexp = 9

exp = exp - 1

      = 1-1 = 0    

exp = 0

  • Here the loop will break now when it reaches third iteration because value of exp is 0 and the loop condition evaluates to false now.
  • return baseexp statement will return the value stored in baseexp which is 9
  • So the output of the above program is 9.
5 0
2 years ago
Give the names of two different places you might find a number represented in hexadecimal
Paladinen [302]

Answer:

Monday or Tuesday or Wednesday I am going back to work

Explanation:

8 0
2 years ago
Which of the following enables robots to do things such as understand itself, walk, talk, and develop skills?
zmey [24]

Answer:

self-modeling

Explanation:

Robots, which are man-made machines which mimics the actions of man like walking, talking, rendering assistance are part of the future plans to make the society easier. It was mans' attempt to improve the society but still happens to be work in progress.

For the robots to be able to carryout its function, there is need for it to be self modelling in the sense of initiating and executing the commands which was already programmed into it. <em>For example, telling it to walk will be initiated by him as a command, after processing the command, it will execute it without any other information.</em>

7 0
3 years ago
Other questions:
  • Which of the four basic functions of a computer refers to the collection of data by a computer?
    11·2 answers
  • Which part of a formal email is optional
    6·2 answers
  • Contemporary operation of networking technology is possible only through the usage of open-use technology and layering approache
    13·1 answer
  • To find your personal learning style you can
    5·2 answers
  • What does the action tool allow you to do in Microsoft power point?
    9·1 answer
  • An aircraft departs an airport in the mountain standard time zone at 1615 MST for a 2-hour 15-minute flight to an airport locate
    14·1 answer
  • Security controls are measures taken to protect systems from attacks on the integrity, confidentiality, and availability of the
    12·1 answer
  • I need help with this plz question 2 and 3 asap
    7·1 answer
  • Deleting anitem from a linked list is best when performed using two pointersso that the deleted item is freed from memory.
    7·1 answer
  • FIRST TO Answer for free brainlest. GOG GOGOGO
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!