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
cluponka [151]
3 years ago
15

All the answers I've got is 0, which seems strange but I'm sure I'm following this algorithm correctly.

Computers and Technology
1 answer:
Salsk061 [2.6K]3 years ago
7 0
I think its six. im not sure but it could be another on.                                                                     

You might be interested in
Which best describes IMEI?
KIM [24]

Answer:

A unique identifier for a wireless subscriber

3 0
3 years ago
The efficiency and effectiveness of a logistics/supply chain operation are constrained by the location of plants and warehouses
Vika [28.1K]

Answer:

True.

Explanation:

7 0
3 years ago
Write a program that helps a young student learn to make change. Use the random number generator to generate change amounts betw
erastovalidia [21]

Answer:

#include <iostream>

#include <stdlib.h>

using namespace std;

int main()

{

srand(time(0));

 

int coins = rand()%99 + 1;

int temp = coins;

cout<<"Enter the coins needed to make $0."<<coins<<"?"<<endl<<endl;

int a, b, c, d;

cout<<"Quarters? ";

cin>>a;

cout<<"Dimes? ";

cin>>b;

cout<<"Nickles? ";

cin>>c;

cout<<"Pennies? ";

cin>>d;

 

int quarters = coins/25;

 

coins = coins%25;

 

int dimes = coins/10;

 

coins = coins%10;

 

int nickles = coins/5;

coins = coins%5;

 

int pennies = coins/1;

 

if(((a*25) + (b*10) + (c*5) + (d*1))==temp)

{

cout<<"That's correct"<<endl;

 

if(a!=quarters || b!=dimes || c!=nickles || d!=pennies)

{

cout<<"The optimized solution is "<<endl;

}

}

else

{

cout<<"Not correct"<<endl;

cout<<"The solution is "<<endl;

 

}

 

cout<<"\tQuarters: "<<quarters<<endl;

cout<<"\tDimes: "<<dimes<<endl;

cout<<"\tNickles: "<<nickles<<endl;

cout<<"\tPennies: "<<pennies<<endl;

return 0;

}#include <iostream>

#include <stdlib.h>

using namespace std;

int main()

{

srand(time(0));

 

int coins = rand()%99 + 1;

int temp = coins;

cout<<"Enter the coins needed to make $0."<<coins<<"?"<<endl<<endl;

int a, b, c, d;

cout<<"Quarters? ";

cin>>a;

cout<<"Dimes? ";

cin>>b;

cout<<"Nickles? ";

cin>>c;

cout<<"Pennies? ";

cin>>d;

 

int quarters = coins/25;

 

coins = coins%25;

 

int dimes = coins/10;

 

coins = coins%10;

 

int nickles = coins/5;

coins = coins%5;

 

int pennies = coins/1;

 

if(((a*25) + (b*10) + (c*5) + (d*1))==temp)

{

cout<<"That's correct"<<endl;

 

if(a!=quarters || b!=dimes || c!=nickles || d!=pennies)

{

cout<<"The optimized solution is "<<endl;

}

}

else

{

cout<<"Not correct"<<endl;

cout<<"The solution is "<<endl;

 

}

 

cout<<"\tQuarters: "<<quarters<<endl;

cout<<"\tDimes: "<<dimes<<endl;

cout<<"\tNickles: "<<nickles<<endl;

cout<<"\tPennies: "<<pennies<<endl;

return 0;

}

Explanation:

  • Use the built-in rand function to generate a random coin.
  • Get all the required values for quarters, dimes, nickles and pennies and store them in variables.
  • Check if the coins give a value of temp, then answer is correct and the values of user will be added.
  • Optimum solution is displayed  If it does not matches with the optimum solution. Display that the answer is wrong along with solution.
6 0
3 years ago
What is it called when a programmer includes a step in an algorithm that lets
Oksanka [162]

Selection is the step in algorithm that let's the computer decide which group of steps to perform.

<h3>What is Algorithm?</h3>

This can be defined as set of instructions which are used for solving a problem or accomplishing a task.

Selection happens when there are one or more options are available in which the computer decide which group of steps to perform.

Read more about Algorithm here brainly.com/question/11302120

3 0
2 years ago
Which statement describes the word "iterative"?
malfutka [58]

Answer:4 should be correct

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Jason is an aspiring filmmaker. He manages finance and makes sure that everyone is involved in the project. Which role is Jason
    12·1 answer
  • Casual or informal group meetings are common. Here youcasually chat over tea, meet after work, or get together for purelysocial
    5·1 answer
  • Write a function that takes a list as a parameter, converts every element in the list to integar and then returns a tuple compri
    12·1 answer
  • You're the network administrator for a company that has just expanded from one floor to two floors of a large building, and the
    7·1 answer
  • What is a disadvantage of shopping online?A.Harder to compare prices than in storesB.A higher risk of financial data theftC.More
    6·2 answers
  • Which objects appear on the slide after she clicks OK? Check all that apply.
    13·1 answer
  • Star and peer-to-peer are types of
    9·2 answers
  • Old systems can be useful when designing new computer software.<br> True or False
    7·2 answers
  • Sam works in a real estate office. An offer comes in on a house but the homeowners are on vacation. He needs the homeowners to s
    13·1 answer
  • Lynn has created a quarterly sales report using a word processor. The document is confidential, and Lynn wants to secure it with
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!