Write a java program which compiles and executes

Assignment Help Basic Computer Science
Reference no: EM13235296

have to complete the following WITHOUT using loops and arrays: Write a Java program which compiles and executes: ask the user for 4 integer values. Each one of these is a percent of a total cake (4 values must total 100) verify that the 4 integers of Step 1 add up to 100 (i.e: 4 values total 100%, full cake- nothing more or less) If they DO NOT add up to 100, print an error message of some form and exit the program (Hint: in main () the return; statement will cause the program to exit) Identify which slice of cake each person too assuming everyone is greedy and takes the largest slice available (person 1 will take the highest value, person 2 the second highest value etc.) THERE ARE 4 PEOPLE IN TOTAL - 1 slice/person The program should look like this: Please enter sizes of the four slices: 20 30 24 26 Person 1 took slice 2 (30%) Person 2 took slice 4 (26%) Person 3 took slice 3 (24%) Person 4 took slice 1 (20%) I use NX Client and the class name will be cake

Reference no: EM13235296

Questions Cloud

Find is the opportunity cost of attending the concert : If you receive a free ticket to a concert, what, if anything, is your opportunity cost of attending the concert How does your opportunity cost change if miserable weather on the night of the concert requires you to leave much earlier
Write a mips program that loads a value from memory location : Write a MIPS program that loads a value from memory location
Why the economy is experiencing high unemployment : If you were having a conversation with a Keynesian and a Classical economist, and the conversation turned to why the economy is experiencing high unemployment and what the government should do about it
Determine the direction of the fourth displacement : A spelunker is surveying a cave. She follows a passage 150m straight west, then 230m in a direction 45, Use a scale drawing to determine the magnitude of the fourth displacement, Determine the direction of the fourth displacement
Write a java program which compiles and executes : Write a Java program which compiles and executes
What is michelles opportunity cost of producing potatoes : If Michelle devotes all her resources to growing potatoes, she can raise 200 pounts of potatoes per year. If she devotes all her resource to raising chickens she can raise 50 chickens per year. (If she apportions some resources to each
Write the pseudo codes for the following : Write the pseudo codes for the following
What is the charge on the earth : The Earth's radius is 6370 km . There is a downward-pointing electric field in the atmosphere above the Earth's surface, What is the flux of the electric field out of the Earth, What is the charge on the Earth
Use the following formula to calculate a car''s mpg : C sharp Write C# code to prompt a user to enter the number of miles he or she has driven and the gallons of gas used

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Computing requirements for dozen handbags

Leather-goods factory manufactures ?ve styles of handbags, whose variable contributions are $30, $40, $45, $25, and $60 per dozen, respectively.

  Use c++ write program that to factorial the prompted integer

use C++ write program that to factorial the prompted integer in the output

  Create an instance variable credit limit to indicate

Create another sub class CreditCustomer. Create an instance variable credit limit to indicate the maximum limit ($500). Credit customers get a markup of 2% on the order price.

  Wish to represent an n-vertex graph

Suppose we wish to represent an n-vertex graph G using the edge list structure, assuming we identify the vertices with the integers in the set {0,1,...,n?1}.

  Why does segment sequence number remain unchanged

Why does the Segment Sequence Number remain unchanged (indicated by a horizontal line in the graphs) with every drop in the congestion window?

  Class automobile has a composite object

Assume that a definition of class Automobile has a composite object called my Engine. Also assuembers of class Engine me the all the data members of class Engine that contain information

  Description of what the computer considers

For your initial post, provide your own description of what the computer considers "TRUE" and what the computer considers "FALSE." Then, provide at least two code examples (original examples) that would return TRUE, and provide a description of what ..

  Elliot bay maintains a roster of personal trainers

Elliot Bay maintains a roster of personal trainers who operate as independent consultants. Approved trainers can schedule appointments with clients at Elliot Bay facilities, as long as their client is a member of the club. Trainers also teach yoga..

  Return a version of the given array

Return a version of the given array where all the 10's have been removed

  Question about compiler theory

Determine some common compilers available? Based on regular expressions, can all input be validated if it is correct, or not, based on compilation?

  Define a class called month that is an abstract data type

Embed your class definition in a test program. I dont get the meaning of test program what am i supposed to do in this assignment?

  Limit approach to determine the order

Use the limit approach to determine the order for g(n) = n^J and f(n) = n^k, where k > j > 2

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd