Program should prompt the user at the beginning

Assignment Help Programming Languages
Reference no: EM13782884

Programming Problems

Follow these instructions for your programming problems:

· You must follow the good programming practices discussed in class. (Remember that in some places the book shows examples that include poor programming practices that are not allowed in this class!)

· You must include appropriate comments in your code.

· For each programming problem, you must create an output text file as discussed in the labs that will show your complete console.

· Be sure that you understand your program completely in English before you try to solve the problem in Java. It helps if you rewrite the problem statement in your own words before you begin coding. Be sure that you think about the explicitly defined information and the implied information from the problem statement.

Modified Milk Problem

Modify the main method in your Milk problem from Homework as follows:

· Be sure to fix any errors in your previous homework.
· The first line of the program after your variables have been declared and initialized should print out Milk Production for Your Name (except use your actual name).
· Use console input and output instead of GUI.
· Be sure to validate your input appropriately.
· The program should prompt the user at the beginning for the number of different milk quantities to evaluate in this one run of the program.
· For any milk quantity that exceeds 25 liters, the profit for each carton of milk increases by 50%.
· For any milk quantity that is lower than 5 liters, the cost for production of one liter of milk increases by 10%.
· The output of the program should be in the format shown below. The program must print out two blank lines between each Quantity of milk evaluated in the run of the program.

Quantity of Milk in liters: 15.85
Cost: $6.02
Profit: $1.08

When you have completed this project run your program for each value of liters of milk listed below. Save all output to a single text file to turn in with this assignment. Remember that your program must work for any numbers that are entered. These are just some samples to use for input to turn in with your homework.

· First run will evaluate the following quantities of milk in liters: 15.85
· Second run will evaluate the following quantities of milk in liters: 75.25, 13.32, 9.8
· Third run will evaluate the following quantities of milk in liters: 100.0, 3.75

Print out a copy of your source code and your output file to turn in with this assignment.

Reference no: EM13782884

Questions Cloud

Create a list of short bulleted phrases showing all details : Rewrite this problem statement in your own words. Create a list of short bulleted phrases showing all details about this problem. This list should include both the explicitly defined and implied details in the problem statement.
Why did you select the six team members you did : Your objective is to individually select a team of six people from the given teammate profiles. Begin by reading "West Coast Transit Company Profile" and "West Coast Transit Team Member Profiles," which are attached in the Topic Materials. Based on y..
New german cinema and italian film-makers : Explain the techniques and the similarities and differences between the French New Wave Cinema and the "Angry Young Man" or "kitchen sink realism" cinema school of Great Britain in the 1960s with the New German Cinema and Italian film-makers of th..
Final assignment on hifsa : It may include explanation and examples from previous experience as well as implications for future application.
Program should prompt the user at the beginning : The program should prompt the user at the beginning for the number of different milk quantities to evaluate in this one run of the program.
Write a response to the given prompt using proper apa style : Write a response to the following prompt using proper APA Style. Prompt: You will watch a short sales presentation for an "As Seen on TV" product.
Three sociological perspectives : Compare the differences among the three major theoretical perspectives in sociology (structural-functionalism, conflict theory, and symbolic interactionism). With which theory and theorist do you find that you share similar views with and why?
Human resourece management questionaire : Which of the following is the difference between training and education?
Lack of standards or the inabilities of the social structure : Anomie is called a lack of standards or the inabilities of the social structure provide certain individuals than necessary to achieve the goals of society.

Reviews

Write a Review

Programming Languages Questions & Answers

  Invoke method to tell air conditioner object to turn on

Assume there is a reference variable myAC to an object of this class, which has already been created. Using the reference variable, invoke a method to tell the air conditioner object to turn on.

  Sequence of statements to find first comma in string line

Write a sequence of statements that finds first comma in String line , and assigns to variable clause portion of line up to, but not including the comma.

  Write a program that replies either leap or not a leap year

Write a program that replies either Leap Year or Not a Leap Year, given a year. It is a leap year if the year is divisible by 4 but not by 100 (for example, 1796 is a leap year because it is divisible by 4 but not by 100).

  Prepare console application to examine contents of text file

Prepare the C++ console application which examines the contents of a text file. Your program must count the number of: * lines (hint: use getline).

  Program that prompts the user to input the dimensions

Amanda and Tyler opened a business that specializes in shipping liquids, such as milk, juice, and water, in cylinderical containers. The shipping charges depend on the amount of liquid in the container.

  What are application programming interfaces apis recognize

what are application programming interfaces apis? identify several apis that could or do exist in the software

  How to create a custom command in unix

How to create a custom command in Unix. Then writing a man page for my command.

  Write down a program to request the user to input a numeric

write a program to request the user to input a numeric value. if the input is even the program will display all the

  Advantages and disadvantages for windows login

The Windows login can be a user or a group with users defined to the group. What do you think the advantages and disadvantages are for each type?

  Program to display number of times name appears in file

You have read all names from the file, display number of times this name appears in file. write logic - step by step - to show code program to accomplish this task.

  Program-function definition which has three int arguments

Your program will include a function definition that has three int arguments consisting of the whole dollar portion of the price and the two integers that make up the fraction part.

  Write implementation of counter class

Write the implementation (.cpp file) of the Counter class. Here is the full specification of the class: A data member counter of type int.

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