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
Naya [18.7K]
3 years ago
12

Write a program to input money in cents from user, example 12745 and display the one dollar bills and the cents. Submit source c

ode.
Computers and Technology
1 answer:
ira [324]3 years ago
6 0

import java.util.*;  //This is used to import the Scanner

class Main {

 public static void main(String[] args) {

   System.out.println("Hello world!");

   Scanner ValCents = new Scanner (System.in);

   System.out.println("Enter Number:");

   int user_input = ValCents.nextInt();

   int result = user_input/100;  // This one will solve for the one dollar bills.

   int remain = user_input % 100;  // This one will get the remainder of cents.

   System.out.println(result + " One Dollar Bills");

   System.out.println(remain + " Cents");

 }

}

Remember that you need to get the amount of dollar bills separately from the number of cents. This is because the int variable will always return the whole value of the number. The modulo is used to get the variable of the cents as the whole number is already taken by the "result".

You might be interested in
6) RAM, 5 main memory<br>which storage conbe used<br>as permanent storage<br>Rom<br>a) R<br>)​
Iteru [2.4K]

Answer:

not interested lol

Explanation:

duh

8 0
3 years ago
Read 2 more answers
True or false. Embedding only part of a font is called presetting.
svetoff [14.1K]
The answer is actually false. Embedding only part of a font is called Subsetting. 
8 0
3 years ago
We love silky. she is very honest join this by using conjunction ​
VladimirAG [237]

Answer:

we love silky because she is very honest

4 0
3 years ago
Read 2 more answers
What is lasso tool write the name of any modelling and animation software<br>​
VladimirAG [237]

Explanation:

6579689993 and password is 3250 I RISHAVjoin please I join yar

7 0
3 years ago
A type of SDLC in which each phase has results that flow into the next phase is called the __________ model.
vovangra [49]
Answer : a type of SCLC in which each phase has results that flow into the next phase is called the waterfall model. Hope that helps (:
7 0
3 years ago
Other questions:
  • How is a computer component, such as a network card, commonly marked for identification?
    12·1 answer
  • 1.Which type of camera tool pushes the picture back and makes it wider, exaggerating the distance between the background and for
    13·2 answers
  • The master production schedule for Product A shows a need for 30 units, and Product B shows a need of 25 units. To manufacture a
    12·1 answer
  • Write a Java statement to create an object LG of class TvSets
    11·1 answer
  • Swapping two input integers if they are not the same. (use switch-case
    10·1 answer
  • Consider the relational schema below: Students(sid: integer, sname: string, major: string) Courses(cid: integer, cname: string,
    9·1 answer
  • What are the characteristics of calendar sharing options in Outlook 2016? Check all that apply.
    13·2 answers
  • Which devices are used in networking
    15·1 answer
  • What are examples of Table Tools options that can help edit data?
    15·2 answers
  • HELP 20 points THIS IS ON EDGE IF YOU DON'T KNOW THE ANSWER DON'T RESPOND
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!