ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 5 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 19 May 2017 My Price 9.00

a program to calculate the area of a circle

Please I have Java programming questions:

JAVA HOMEWORK-1

Write a program to calculate the area of a circle ( 3.1425*r*r ). The program will output the area of the circle based on a radius value initialized in the program.

 

JAVA HOMEWORK-2

Write a program that reads an integer value between 0 and 100 (inclusive), representing the amount of a purchase in cents. Produce an error message if the input value is not in range. If the input is valid, determine the amount of change that would be received from one dollar, and print the number of quarters, dimes, nickels, and pennies that should be returned. Maximize the coins with the highest value.

Follow the format below.

Enter the purchase amount [0-100 ]: 36

OUTPUT:

Your change of 64 cents is given as:

2 Quarters

1 Dimes

0 Nickels

4 Pennies

 

HINT: 64 / 25 equals 2, and 64 % 25 equals 14

 

Use the following lines of code to read an integer from the user. The Scanner object will be used.

Don't forget to import the java.util.Scanner package.

 

import java.util.Scanner;

 

public static void main(String[] args) {

 

// Declare a data type Scanner

 

int number;

Scanner scan = new Scanner (System.in);

 

System.out.println("Input a number: ");

number = scan.nextInt();

 

// .....program logic goes here .....

 

} // end main

 

 

 

Thank you

Attachments:

Answers

(11)
Status NEW Posted 19 May 2017 07:05 AM My Price 9.00

-----------

Attachments

file 1495179328-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)