Homework 05
Coffee Hour

Due 03/22/2024 at 11:55pm

 

Objective: 

Create a program that has a class to represent a cup of coffee that combines the properties: name and caffeine content. The class should also have a method that calculates the number of cups that would be maximally risky to consume in a short period of time. The program should create two instances of the class coffee where the user enters their properties and should output the number of coffees that consumed would be risky.

 

Requirements:

Coffee Name: <<coffee’s name>> Caffeine Amount: <<coffee’s caffeine amount>>

 

Risky Cup Amount = 180.0 / ((Caffeine Content / 100.0)*6.0)

 

 

Example Dialog:

*The following Example Dialog demonstrates the interactions between a user and ONE possible implementation of the required software’s front-end / user interface. The software’s front-end / user interface may be implemented in MANY different ways and will receive full credit as long as it meets the most minimal of the above requirements. While you may use the example dialog as a guide, it is strongly encouraged to create the front-end / user interface in your own way. *

Key

Unhighlighted Text

Program’s Output

Highlighted Text

User’s Input

 

Let’s Coffee!!!1!11!!ONE!!!1!

 

What’s the name of the first coffee?

Double Triple Loca Mocha Latte Venti Grande

What’s the caffeine content?

150

 

What’s the name of the second coffee?

Waffle House Coffee

What’s the caffeine content?

100

It would take 20.0 Double Triple Loca Mocha Latte Venti Grande coffees before it’s dangerous to drink more.

It would take 30.0 Waffle House Coffee coffees to before it’s dangerous to drink more.

 

 

Finally:

Upload the all Java source files (.JAVA extension) to the CSCE Dropbox