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]
4 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]4 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
How do professionals address their problems?
8090 [49]

Answer:

b, with grace and maturity

6 0
3 years ago
Read 2 more answers
Which is true regarding pseudocode?
bearhunter [10]

Answer:

It uses simple words and symbols to communicate the design of a program

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer on how to perform a specific task and solve a particular problem.

A software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications. There are seven (7) main stages in the creation of a software and these are;

1. Planning.

2. Analysis.

3. Design.

4. Development (coding).

5. Testing.

6. Implementation and execution.

7. Maintenance.

A pseudocode refers to the description of the steps contained in an algorithm using a plain or natural language. Also, a pseudocode gives a summary of the steps adopted during a software development process using simple (concise) words and symbols.

This ultimately implies that, a pseudocode uses simple words and symbols to communicate the design of a program.

8 0
3 years ago
Read 2 more answers
Choose the answer.
Alik [6]
A home network aswell business networking would use a Router to connect the lam and internet all together
3 0
2 years ago
Read 2 more answers
How to be like Elon Musk who achieved more in his 46 years than we will ever achieve in ten lifetimes?
kvasek [131]

Answer:

You can just be yourself?

4 0
4 years ago
What is an occupation?​
LiRa [457]

Answer:

a job or profession.

4 0
3 years ago
Other questions:
  • . When you have multiple graphics positioned on a page, you can _______________ them so that they are a single graphic instead o
    9·1 answer
  • Which best describes the benefits of renting a home?
    10·2 answers
  • In cell R9, enter a formula using the AVERAGEIF function to determine the average number of years of experience for lifeguards.
    12·1 answer
  • Give sally sue specific suggestions on how she can improve her powerpoint skills
    5·1 answer
  • With the ease of the Internet, it is not uncommon for individuals to copy skills from resume templates to make themselves look m
    9·1 answer
  • This diagram shows a number of computing devices connected to the Internet with each line representing a direct connection.
    11·1 answer
  • What safety feature melts to protect a circuit? a. fuse b. diode c. three-prong plug d. transistor
    10·2 answers
  • How many questions have you seen so far other than this one?
    10·2 answers
  • What's the smallest part of a computer
    8·2 answers
  • 5 differences between a regular mouse and a gaming mouse​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!