[Solved] COMP2710 Homework 1- Artificial sweetener needed to kill a mouse

$25

File Name: COMP2710_Homework_1-_Artificial_sweetener_needed_to_kill_a_mouse.zip
File Size: 602.88 KB

SKU: [Solved] COMP2710 Homework 1- Artificial sweetener needed to kill a mouse Category: Tag:
5/5 - (1 vote)

A government research lab has concluded that an artificial sweetener commonly used in diet soda will cause death in laboratory mice. A friend of yours is desperate to lose weight but cannot give up soda. Your friend wants to know how much diet soda it is possible to drink without dying as a result. Write a program to supply the answer. The input to the program is the amount of artificial sweetener needed to kill a mouse, the weight of the mouse, and the weight of the dieter. To ensure the safety of your friend, be sure the program requests the weight at which the dieter will stop dieting, rather than the dieters current weight. Assume that diet soda contains one-tenth of 1% artificial sweetener. Use a variable declaration with the modifier const to give a name to this fraction. You may want to express the percentage as the double value 0.001.

Programming Environment:

Write a short program in C++. Files will be graded using the jGrasp on a CoE PC.

Requirements:

  1. Use comments to provide a heading at the top of your code containing your name and Auburn Userid, partners name and Auburn ID <or NONE>, filename. Also, describe any help or sources that you used (as per the syllabus). Include a brief statement of the problem.

// name: Sally Ride, szr0001

// partner: Lizz Jones, lzj0001 (NONE if work alone)

// filename: hw01.cpp

// due date: 08/31/2018

// collaboration: I got help with data types from the TA.

(OR I did not use any external sources for this assignment.)

// problem: determine how much diet soda it is possible to drink

// without dying as a result

  1. (5 points) Your source code file should be named as hw1.cpp. (10 points) No compilation error and no warning messages
  2. (5 points) Use modifier const for the fraction.
  3. (5 points) Usability of your program (e.g., input and output)
  4. (70 points) Quality of your source code.

You will lose points if you: do not use the specific program file name, or do not have a comment block on EVERY program you hand in.

Here is a sample dialog (where the user input is depicted as Bold, but you do not need to display user input in bold.):

What is the amount of artificial sweetener needed to kill a mouse:

0.002

What is the weight of the mouse: 1

What is the weight of the dieter: 114

You can drink 228 diet soda without dying as a result.

Your programs output should match the style of the sample output.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] COMP2710 Homework 1- Artificial sweetener needed to kill a mouse
$25