How much the user will spend on beer this year

Assignment Help Computer Engineering
Reference no: EM132201168

Write a Java programm

Problem A: Cost of Beer

Studies have shown that, on average, someone who consumes a single 12-ounce can of beer every day without compensating for the calorie intake through diet modifications or extra exercise, will gain approximately 15 pounds in one year. You can assume this ratio of beer-to-weight-gain is constant.

(For example, doubling the beer consumption to two 12-ounce cans per day will lead to 30 pounds of extra weight in one year.)

You will have to ask the user how many beers he or she expects to consume each day, on average, as well as the average amount of money he or she spends on a single 12-ounce can of beer. Using this information, your goal is to write a program to determine the following:

How many beers will the user consume over the course of the year?

Assuming a beer is 150 calories, how many calories will the user take in from beer alone over the course of the year?

How much weight can the user expect to gain in one year based on the number of 12-ounce beers they consume every day?

How much the user will spend on beer this year?

All output should be displayed using 2 digits of precision after the decimal point!

You may assume that there are 365 days in a year (ignoring leap years).

Input Specification

The number of 12-ounce beers consumed each day will be a non-negative real number.

How much the user spends on a single beer, on average, will be a positive real number. (Some people like cheap beer, while others pay a bit more for their favorite brand.)

Output Sample

Here is one sample output of running the program. Note that this test is NOT a comprehensive test. You should test your program with different data than is shown here based on the specifications given.

The user input is given in italics while the program output is in bold.

Sample Run #1

On average, how many beers will you consume each day?

2.5

On average, how much will you pay for each can of beer?

1.25

That is approximately 912.50 beers in one year.

In one year, you will consume approximately 136875.00 calories from beer alone.

Without diet or exercise to counter these calories, you can expect to gain 37.50 pounds from drinking that much beer this year.

Reference no: EM132201168

Questions Cloud

Random sample of 88 adults from a particular town : In a random sample of 88 adults from a particular town, it is found that 6 of them have been exposed to a certain flu strain.
How much project is chosen by the reliable a : Suppose two business partners get together and they consider a project. The partner B has an established reputation for being reliable.
Write a program which will display a line of text : Write a JavaScript program which will display a line of text. When the text clicked, its color will randomly change.
Write and lest a recursive java method that reverses list : Write and lest a recursive Java method that reverses a singly linked list so that the ordering of the nodes becomes opposite of what it was before.
How much the user will spend on beer this year : Assuming a beer is 150 calories, how many calories will the user take in from beer alone over the course of the year?
Write a lc-3 assembly program to subtract two integers : Write a LC-3 assembly program to subtract two integers (between 0 and 9) provided by the user.
What is the margin of error : If a confidence interval is given from 8.50 to 10.25 and the mean is known to be 9.375, what is the margin of error?
Baseball company produces balls with a mean distance : A baseball company produces balls with a mean distance of 295 yds. the company is concerned if the mean drops below 295, sales will drop.
Explain the sample mean-median and standard deviation : Explain the sample mean, median, and standard deviation? Does it increase, decrease, or remain the same.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write a program to handle student data in an input file

Write a program to handle student data in an input file. Each line in the file represents information for one student.

  Summarize the methodologies you used for your system

Summarize your selected software system to provide context for your colleagues. Summarise the methodologies you used for your system.

  Build a program to implement the selection sort algorithm

build a program to implement the selection sort algorithm, which will sort a list of strings. Selection sort function should sort the list of strings in alphabetical order. You only need to provide the details for the selectionSort() function base..

  Explain the different types of raid

Explain the different types of RAID, and elaborate on how each type differs:

  Find the index locations of multiple matches

Find the index locations of multiple matches to a string using binary search (Java).

  How many 2 gb hard disks do you need if the hard disk

How many 2 GB hard disks do you need if the hard disk should store up to 70% of their capacity using RAID 0, RAID 1, RAID 3, or RAID 5.

  Write a recursive function pattern that accepts one argument

Write a recursive function pattern that accepts one argument, an integer that is a power of 2, and prints the following patterns.

  What is the wavelength of the light used

if the distance between the first and fifth maxima of a double slit pattern is 1,2 mm and the slits are separated by 0,15 mm with the screen 70 cmfrom the slits,what is the wavelength of the light used?

  Determining the salary of person

Write down a program which determines how much a person earns in a month in case the salary is one penny first day, two pennies second day, four pennies the third day, and so on with the daily pay doubling each day employee works.

  Design the logic for a program that output every even number

Design the logic for a program that outputs every even number from 2 through 30.

  Distinguish software needs versus software wants

Search the internet for tips on how to distinguish software needs versus software wants. From your research, summarize 3 of most common tips.

  How many private sections are required in a class

How many public: sections are required in a class for the class to be useful? How many private: sections are required in a class?

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