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
ad-work [718]
4 years ago
9

1. Write a function that will ask the user to enter a value in dollars. The function should calculate and display the equivalent

number of pennies, nickels, dimes, and quarters. Acceptable values are those which when multiplied by 100 will be exactly divisible by 50 (100*value must be exactly divisible by 50). Write a caller main function to call your function.
Computers and Technology
1 answer:
julia-pushkina [17]4 years ago
3 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    valueInDollars();

}

   public static void valueInDollars() {

       double currentMoney, quarters, dimes, nickels, pennies;

       Scanner input = new Scanner(System.in);

       

       System.out.print("Enter a value in dollars: ");

       currentMoney = input.nextDouble();

       currentMoney *= 100;

       quarters = (int)currentMoney / 25;

       currentMoney = currentMoney % 25;

       

       dimes = (int)currentMoney / 10;

       currentMoney = currentMoney % 10;

       

       nickels = (int)currentMoney / 5;

       currentMoney = currentMoney % 5;

       

       pennies = currentMoney;

       

       System.out.print("Quarters: " + quarters + "\n" + "Dimes: " + dimes + "\n" + "Nickels: " + nickels + "\n" + "Pennies: " + pennies);

   }

}

Explanation:

<u>Inside the function:</u>

- Declare the variables

- Ask the user for a value in dollars

- Multiply that value by 100

- Find the amount of quarters, dimes, nickels, and pennies

- Print the values

<u>Inside the main:</u>

- Call the function

You might be interested in
A user who enters americanbank.net into a web browser instead of the correct americanbank and is then taken to a fake look-alike
Vlada [557]

Answer:

Typosquatting is the correct answer.

Explanation:

Typosquatting is another type of cybersquatting in which any user or person enters into the others sites from the web browser and then, they create another fake that is usually same as that site. They also create that type of address of the fake websites that is somewhere similar to the original and these are illegal in many countries.

6 0
4 years ago
Read 2 more answers
Write a Java program that generates a new string by concatenating the reversed substrings of even indexes and odd indexes separa
salantis [7]

Answer:

/ReversedEvenOddString.java

import java.util.Scanner;

public class ReversedEvenOddString {

   public static void main(String[] args) {

       Scanner sc = new Scanner(System.in);

       String s = sc.nextLine();

       String evens = "";

       String odds = "";

       for(int i = s.length()-1;i>=0;i--){

           if(i%2==1){

               odds += s.charAt(i);

           }

           else{

               evens += s.charAt(i);

           }

       }

       String res;

       if(s.length()%2==1){

           res = evens+odds;

       }

       else{

           res = odds+evens;

       }

       System.out.println(res);

   }

}

8 0
4 years ago
1. Given two relations R1 and R2, where R1 contains N1 tuples and R2 contains N2 tuples, and N2&gt;N1&gt; 0, give the maximum an
Anna007 [38]

Answer:

Explanation:

A. Max is correct But min will be max(N1,N2) i.e. N2.

B. max=N1, min=0(no common tuples in R1 and R2)

C. max=N1(R1 and R2 are disjoint sets), min=0(all tuples of R1 are present in R2)

D. max=N1*N2, min=N1*N2

6 0
4 years ago
Firewalls are categorized into two; namely hardware firewall and software firewall. Identify the correct statement for a softwar
garri49 [273]

Answer:

Option (d) Software firewall is placed between the normal application and the networking components of the operating system

Explanation:

  • Software Firewalls protect the computer from trojans and malicious content which can arise from unsafe applications.
  • It also protect the computer from external network.
  • It filters the data to and from a software application in the desktop.
  • It also filters the data to and from a network.
  • It safeguards the computer from not loosing access to the attackers.
  • It is customizable software and has to be monitored like installing updates and storage spaces etc.
  • Software Firewall in conjunction with the Hardware Firewall must be used for the security of the desktop and the networks.
5 0
3 years ago
Which software program is used to create a database on a computer, add, change, and delete data in the database, and create quer
Radda [10]
I'd say Microsoft access
3 0
3 years ago
Read 2 more answers
Other questions:
  • Jim has entered the age of each of his classmates in cells A1 through A65 of a spreadsheet. Which function should Jim use to fin
    11·2 answers
  • In Microsoft Excel graphs are referred to as ______?
    14·2 answers
  • What is a common method for testing a spot weld?
    13·1 answer
  • Which of the following is an Important criterion for evaluating the effctiveness of a graphic organizer
    14·2 answers
  • The critical path in a project network is:______ A. The Shortest path through the network. B. Longest path through the network.
    8·1 answer
  • A(n) monitoring vulnerability scanner is one that listens in on the network and determines vulnerable versions of both server an
    7·1 answer
  • Let’s say you are given a number, a, and you want to find its square root. One way to do that is to start with a very rough gues
    15·1 answer
  • Which BEST identifies the primary function of the key words above?
    5·1 answer
  • PLEASE HURRYYY Suppose your employer wants you to purchase a tablet device that you will use to run the company's custom sales s
    15·2 answers
  • How to do a linear equations
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!