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
zalisa [80]
3 years ago
8

Write a C# program that prints the number of quarters, dimes, nickels, and pennies that a customer should get back as change. De

clare and initialize all memory locations as integers. On output, show the original change amount as a monetary amount, with two positions to the right of the decimal. Run your program once by performing a compile-time initialization using 92 cents for the value to be converted.
Computers and Technology
1 answer:
kondor19780726 [428]3 years ago
6 0

Following are the code of C# to prints the number of quarters, dimes, nickels, and pennies

Program Explanation:

  • Declaration of the namespace.
  • Made a class named "Class1".
  • Declared the methods as well as the attributes.
  • Declared the main method.
  • Wrote the statements according to the given query.

Program:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Project1

{

   class Class1      

   {

       static void Main(string[] args)

       {

           int change = 0;

           int quart, dim, nic, pen;

           Console.WriteLine("enter amount of cents (less than 99)");

           change = int.Parse(Console.ReadLine());

           quart = change / 25; //calculate the remainder              

           int p = change % 25;

           dim = (p / 10);

           int a = p % 10;

           // Nickles

           nic = a / 5;

           int c = a % 5;

           pen = c;

           Console.Write("There are {0} quarters.\n", quart);

           Console.Write("There are {0} dimes.\n", dim);

           Console.Write("There are {0} nickels.\n", nic);

           Console.Write("There are {0} pennies.\n", pen);

           Console.ReadLine();

       }

   }

}

Output:

Please find the attachment of the output.

Learn more about C# here:

brainly.com/question/5023004

You might be interested in
Which slideshows design can not be use?
Readme [11.4K]

Answer:

Is there suppose to be a pic ?

Explanation:

7 0
3 years ago
What is the only language a microprocessor can process directly but most programmers almost never write programs in this code? Q
elixir [45]
A microprocessor can directly process machine code but most programmers almost never write in it.
C. Machine code
7 0
3 years ago
Read 2 more answers
Audrey would like to save her document. She should choose the Save command from the _____. folder menu window directory
Damm [24]

Answer:

File folder

Explanation:

6 0
3 years ago
Sentiment analysis algorithms use simple terms to express sentiment about a product or service, so ________ makes it __________
Anna35 [415]

Answer:

sarcasm , difficult

Explanation:

Sarcasm make it difficult to classify online content as positive ,negative or neutral because sarcasm content had many meaning and it involve some humor also which make it difficult weather to classify as positive or negative or neutral.

5 0
3 years ago
1. Science is the body of knowledge and methods produced by engineering.
olga nikolaevna [1]
True. Technology changes society
6 0
3 years ago
Other questions:
  • Public static void prefixmerge(customer[] list1, customer[] list2, customer[] result {
    6·1 answer
  • What should a system administrator use to disable access to a custom application for a group of users?
    5·1 answer
  • The picture that graphically represents the items you use in Windows is called a/an
    15·1 answer
  • With only a floor plan to reference, the designer would know what about a window?
    7·1 answer
  • HELP
    13·1 answer
  • Which of the following is a correct statement about writing down passwords on a ""cheat sheet?""
    7·1 answer
  • What do GUI use except​
    10·1 answer
  • Consider the following method.
    14·1 answer
  • 4. Cash inflows from investing activities normally arise from all of the following EXCEPT
    14·1 answer
  • Marc is creating a physical design, what aspect of the design deals with the interaction between a user and data?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!