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

  Responsibility to maintain ethical standard in department

Do managers have a responsibility to maintain an ethical standard within a department? If so, how is the expected ethical standard established? How is it documented? How is compliance measured?

  Implement the stack and queue with a single class

Implement the stack and queue with a single class interfaces with a unique class that is derived from class LinkedDeque (Code Fragment 5.21)

  Business intelligence and data warehouses

Business Intelligence and Data Warehouses

  Secure operations in globally interconnected commercial

Has its creation increased or decreased the need for organizations to maintain secure operation of their systems? Why?

  What are the main disadvantages of hypermedia

What are the main disadvantages of hypermedia when compared with conventional media such as books and videos?

  What some of the ways you would troubleshoot a dns problem

What are some of the ways you would troubleshoot a DNS problem

  Results of password cracker designed for operating system

Download a password cracker designed for your operating system. Run the cracker on your system. Explain the results from the cracker.

  Write program to enter two separate numbers

Write a program which would permit a user to enter two separate numbers and choose one of four mathematical operations (add, subtract, multiply, divide).

  Find syntax errors the definitions of the following classes

Find the syntax errors in the definitions of the following classes. a. class AA { public: void print() const ; int sum(); AA(); int AA(int, int); private: int x; int y; }; b. class BB { int one; int two; public: ..

  Write a method switchpairs that switches the order

Write a method switchPairs that switches the order of elements in a linked list of integers in a pairwise fashion. Your method should switch the order of the first two values, then switch the order of the next two, switch the order of the next two..

  Describe how the deadlocks can be resolved

give at least two real life examples ( not related to a computer system invironment) of each of these concepts:deadlock, starvation, and race. describe how the deadlocks can be resolved.

  Write a select statement that returns four columns

Write a SELECT statement that returns four columns: VendorName

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