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
The Magic Square is a grid with 3 rows and 3 columns with the following properties: The grid contains every number from 1 to 9.
riadik2000 [5.3K]
Umm I’m sorry but u don’t understand
8 0
3 years ago
You have just installed a new NIC in your PC to replace the old one that had started malfunctioning. What additional software mu
miskamm [114]

Answer:

The additional software that must be installed is a device driver.  

Explanation:

Device driver is a software program that is used to control a device connected to a computer.

If a user later buys a new type of device that the operating system did not recognize, new device driver will have to be installed just as in the given question when new NIC is installed. Device driver allows communication between hardware device and operating system.

So device driver will allow the OS to communicate with the new installed NIC.

4 0
3 years ago
Sub to the channel plz plz
Hunter-Best [27]

Answer:

um

Explanation:

6 0
3 years ago
Read 2 more answers
What is one difference between a web page and a web application?
saul85 [17]

Answer:

A website is a group of globally accessible, interlinked web pages which have a single domain name. A web application is a software or program which is accessible using any web browser. Developing your website helps you in branding your business.

8 0
3 years ago
Why do scientists use computers to map El Nino?
Zielflug [23.3K]
El Nino is a meteorogycal phenomenom that affects certain areas . My best guess is that computers are used to map in which areas and patterns this phenomenom affects.
8 0
4 years ago
Read 2 more answers
Other questions:
  • Suppose a subnet has a prefix 128.119.44.128/26. Give an example of an IP address from this subnet. If an ISP owns a block of ad
    14·2 answers
  • People must use Telepresence when Virtually meeting with a group of coworkers true or false
    6·1 answer
  • "a​ _______ network delivers user data in many different geographical locations and makes those data available in a way that min
    5·1 answer
  • Write a program that reads from user (i) an hour between 1 to 12 and (ii) number of hours ahead. The program should print the ti
    15·1 answer
  • 3 thing I learned in ICT
    7·1 answer
  • 1. The best program to present numerical data in would be ____. a. Access c. PowerPoint b. Excel d. Word
    6·1 answer
  • PLEASE HELPP!!!!!
    14·1 answer
  • Write code that prompts for three integers, averages them, and prints the average. Make your code robust against invalid input;
    7·1 answer
  • Now that you have your file holding your data, you need to analyze the data in three different ways that answer questions you po
    7·1 answer
  • Your class requires you to use a program you must download on your computer. You have waited until day 5 of the week to download
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!