CSE1OOF Object-Oriented Programming Fundamentals Assignment

Assignment Help Other Subject
Reference no: EM132406456

CSE1OOF/4OOF Object-Oriented Programming Fundamentals Assignment

Summer 1, 2018 - Department of Computer Science and Information Technology, La Trobe University, Australia

Task 1 - Pantry.java

Background - Task 1 - Pantry

You are tasked with writing a program to enter the contents of your pantry in one unit and display the contents in other units.

Follow the steps to complete the task using the steps and information above. (Note indentation indicates that the indented parts are contained within the previous step. Eg. All steps within an if statement are indented).

1. The program prints to the screen the student name and student number. This is enclosed by triple asterisks. Ensure you follow the below format.

2. The following variables are declared:

a. haveEggs as an int

b. haveFlourKilograms as a float

c. haveMilkMillilitres as a double

d. haveSugarOunces as a double

e. specialIngredient as a String

f. haveSpecialIngredient as a Boolean

3. The program then asks the user for each of the items as shown below.

Store into the variables in declared in 2.

Make sure to follow exact format

Text in 'red' are example inputs

4. Create variables and give a suitable and meaningful name (use the above names to help):

a. A double for storing the number of dozens of eggs you have

b. A float for storing the amount of flour you have in grams

c. An int for storing the amount of milk you have in litres

d. An int for storing the amount of sugar you have in grams

5. Store the number of dozens of eggs you have. There are 12 eggs in a dozen.

6. Store the amount of flour you have in grams. There is 1000 grams in 1 kilogram.

7. Store the amount of milk you have in litres. There is 1000 millilitres in 1 litre. (discard information after the decimal point)

8. Store the amount of sugar you have in grams. Multiply grams by 28.35 to get ounces. (discard information after the decimal point)

9. Print to the screen the results

Remember these values are calculated (DO NOT HARDCODE).

Make sure to follow exact format (Including full stops).

Task 2 - PantryFile.java

You are tasked with writing a program to enter the contents of your pantry from a file and display the contents. There is no converting units in this task.

1. The program prints to the screen the student name and student number. This is enclosed by triple asterisks. Ensure you follow the below format.

2. The program then asks the user to enter a file name

3. The program opens the file with given file name

4. The program then reads the following lines from the file and stores appropriately:

a. An int that represents the number of eggs

b. A double that represents the amount of flour in grams you have

c. An int that represents the amount of milk in litres you have

d. A double that represents the amount of sugar in grams you have

e. A String that represents the special ingredient you have

f. A Boolean that represents if you have the special ingredient

5. Print to the screen the results

Remember these values are calculated (DO NOT HARDCODE).

Make sure to follow exact format (Including full stops).

The special ingredient must be printed in all lowercase letters.

Task 3 - Ingredients.java

You are tasked with writing a program to print out the ingredients of a cake based on the user selection of the cake and the number of servings.

Follow the steps to complete the task using the steps and information above. (Note indentation indicates that the indented parts are contained or related to the previous step. Eg. All steps within an if statement are indented)

1. The program prints to the screen the student name and student number. This is enclosed by triple asterisks. Ensure you follow the below format.

2. The program asks the user to choose a cake as shown below. You can assume the user always enters a valid integer.

a. Make sure to follow exact format

b. Text in 'red' are example inputs

c. Before the lines starting with 1., 2. and 3. , is a single tab.

3. The program asks the user for the number of servings and stores the result in an int variable

4. Using the following information design the code to print the result as shown (see below examples)

a. If the cake is a chocolate cake (Option 1)

i. Ask the user if they would like 'milk' or 'dark' chocolate

ii. Store the result in a String

iii. If 'Milk', the special ingredient is "Milk Chocolate" (equals method may be useful here, any case should be accepted)

iv. Else if 'Dark', the special ingredient is "Dark Chocloate"

v. The cake requires

- ¾ blocks of chocolate per serving

- 1 egg per serving

- 200 grams of flour per serving

- 50 millilitres of milk per serving

- 50 grams of sugar per serving

b. If the cake is a butter cake (Option 2)

The special ingredient is "Butter"

- ½ blocks of butter per serving

- 1 egg per serving

- 180 grams of flour per serving

- 60 millilitres of milk per serving

- 50 grams of sugar per serving

c. Else if the cake is a cheese cake (Option 3)

The special ingredient is "Cheese"

- ¼ blocks of cheese per serving

- 0 eggs per serving

- 300 grams of flour per serving

- 20 millilitres of milk per serving

- 20 grams of sugar per serving

Task 4 - ShoppingList.java

You are tasked with writing a program to generate a shopping list based on the cake and servings the user would like and what items they already have.

Flour is sold only in 1kg bags

Milk is sold only in 1L bottles

Sugar is sold only in 500gram bags

Note: This task reuses parts from previous tasks.

1. The program prints to the screen the student name and student number. This is enclosed by triple asterisks. Ensure you follow the below format.

2. The program asks the user to choose a cake as shown below. You can assume the user always enters a valid integer.

a. Make sure to follow exact format

b. Text in 'red' are example inputs

c. Before the lines starting with 1., 2. and 3. , is a single tab.

3. The program asks the user for the number of servings and stores the result in an int variable

4. The following variables are declared:

a. needEggs as an int

b. needFlourGrams as an int

c. needMilkMillilitres as an int

d. needSugarGrams as an int

e. needSpecialIngredient as a String

f. needBlocksSpecialIngredient as a double

(These are not the only variables needed in the program, you will need to work out the rest)

5. Based on Task 3 values, store the special ingredient and amount needed of each ingredient given the cake type and servings, into the variables declared in step 3. Do not print the ingredient list in this task.

6. Create variables and give a suitable and meaningful name (use the above names to help):

a. An int for storing the number of eggs you have.

b. An int for storing the amount of flour you have in grams.

c. An int for storing the amount of milk you have in milli litres.

d. An int for storing the amount of sugar you have in grams.

e. A double for storing how many blocks of the special ingredient you have.

7. The program then asks the user for each of the items as shown below.

- Store into the variables in declared in 2.

- Make sure to follow exact format.

- Text in 'red' are example inputs.

- Text in 'blue' is generated based on previous responses.

- The special ingredient should be all lower case.

8. If the user has all the required ingredients print the following message

9. Else

a. Print the following

b. Then, if they need to purchase eggs, list the number of eggs to purchase using the format below. (Do not print anything if they do not need eggs).

c. Then, if they need to purchase flour, list the number of bags of 1kg flour to purchase. Flour must be purchased in multiples of 1kg. So even if they only require 10 grams, they will need to purchase 1kg, if they need 1010grams, they will need to purchase 2kg.

(The % operator would be helpful here)

(Do not print anything if they do not need flour)

(Refer to example output for format)

d. Then, as with flour, milk must be purchased in multiples of 1L. Follow the same process.

e. Then as with milk and flour, sugar must be purchased in multiples of 500grams. Follow the same process.

f. Then, if they need to purchase the special ingredient. List the number of blocks to purchase. Blocks must be purchased whole.

Use the Math class covered in Lab 1, and the ceil function to list the correct number of blocks.

Attachment:- Object-Oriented Programming Fundamentals Assignment Files.rar

Reference no: EM132406456

Questions Cloud

What is project w net present value : If the cost of capital is 14%, what is Project W's net present value (NPV)? What is Project W's IRR? What is Project W's MIRR?
What do you think are most important ethical considerations : What do you think are the most important ethical considerations that a healthcare organization must address when developing a marketing strategy
How psychological testing assist with differential diagnosis : Research the role of psychological testing in counseling. Discuss how psychological testing can assist with differential diagnosis.
What other factors could you add to your profile : School shootings have unfortunately become a common occurrence in today's society. Students of all ages are affected, from those in elementary school to those.
CSE1OOF Object-Oriented Programming Fundamentals Assignment : CSE1OOF/4OOF Object-Oriented Programming Fundamentals Assignment Help and Solution, La Trobe University, Australia. Task 1 - Pantry.java
Calculate amount of revenue that buffalo should recognize : Buffalo Ltd., an equipment manufacturer, sold and delivered a piece of equipment to a buyer for $104,000, with 50% payable in one year and the remaining 50%.
What is the definition of forgiveness that you now hold : What is the definition of forgiveness that you now hold? (include: What is forgiveness? What is it not? Are there unforgiveable acts (why/why not)?).
Calculate discount rate to be applied in calculating cash : Blossom Inc. sold a unit of inventory to a buyer for $1,000 payable in one year. Blossom estimates that the interest rate for a similar financing arrangement.
What is the percentage depreciation dragon will use : How much depreciation expense will Dragon have each year of the car's use? What is the percentage depreciation Dragon will use?

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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