diff_months: 15

SIT102 C++ Initial Stage Programming

Download Solution Now
Added on: 2023-02-11 05:23:37
Order Code: MAS4040
Question Task Id: 0
  • Subject Code :

    SIT102

  • Country :

    Australia

Task Description 

You are required to write a program to continuously enter the following information until the user chooses to exit. 

  • Chemical Name 
  • Year purchased 
  • Supplier 
  • Quantity 
  • Cost 
  • Toxicity (out of 10) 
  • Flammability (out of 10) 
  • Corrosiveness (out of 10) 
  • Explosive (out of 10) 
  • Harmful (out of 10) 

After the data has been entered correctly, calculate the overall rating of the chemical as follows. 

  • Toxicity (out of 10) : 20% of overall rating 
  • Flammability (out of 10 : 20% of overall rating 
  • Corrosiveness (out of 10 : 14.5% of overall rating 
  • Explosive (out of 10) : 30% of overall rating 
  • Harmful (out of 10) : 15.5% of overall rating 

Express the overall rating as a whole number out of 10 and write the rating as a series of '*' characters. An example of the expected output of your program is shown below: 

Enter the following chemical data 

Chemical Name > hydrofluoric acid 

Year purchased > 2010 

Supplier > Acme chemicals 

Quantity (L/Kg) > 3.5 

Cost > 65.55 

Rate the following out of 10 

Toxicity > 7 

Flammability > 6 

Corrosiveness > 4 

Explosive > 8 

Harmful > 7 

Overall rating is 7/10 : ******* 

Exit (y/n) > y

Project 1 Part 1 

Notes:  

  • Ensure you desk check the example calculations as this information is example data only 
  • You DO NOT have to provide looping or any error checking. For now your program only has to exit after the  first chemical has been entered and calculated (i.e. your program should exit no matter whether the user  enters ‘Y’ or ‘N’ at the exit prompt). 
  • Organise and indent your code. 
  • Provide a general comment at the top of the C# file containing your name and Deakin College ID 
  • Provide code comments as required 

Project 1 Part 2 

Program description: 

Develop a program that extends off your previous part 1 submission and allows for additional features including  input validation, in order to create a more robust software application. 

Notes:  

Your program should display appropriate informative prompts, retrieve the data from the keyboard and check the  data is valid then store each entry to be used to display output or used to calculate the overall rating. 

Where an error has been detected in the data entry process, display an appropriate message then exit the program. Error checking should include: 

  • Name and Supplier cannot be blank or empty 
  • Year must be 4 digits and start with 20, year must be greater than 2010 and not higher than the current year.
  • Quantity can be decimal and must be greater than 0 
  • Cost can be decimal, and must be greater than 0 
  • Data entered is a valid type. EG: Ratings must be integers, quantity must be decimal etc.
  • Data entered is within the correct constraints. EG: Ratings must be 0 to 10 only 

You should output the results a follows (Note in the example the results are formatted and aligned):

You should output the results a follows: 

Enter the following chemical data 

Chemical Name > hydrofluoric acid 

Year purchased > 2011 

Supplier > Acme chemicals 

Quantity (L/Kg) > 3.5 

Cost > 35.65 

Rate the following out of 10 

Toxicity > 7 

Flammability > 6 

Corrosiveness > 4 

Explosive > 8 

Harmful > 7 

Overall rating is 7/10: *******

Express the overall rating as a whole number out of 10 and write the rating as a series of '*' characters. Ensure you place a comment at the top of the program that contains your full name and student number. Place comments in your code as required and ensure you layout your code appropriately.

Project 1 Part 3 

Program description: 

Develop a program that continuously collects information about a chemical and associated rating until the user  decided to exit the program as per the Task Description. 

Using the solution provided for project 1 part 3 or your code, enhance and change the program to perform the  following: 

Create a menu that contains the following options: 

  • Get chemical details (m) 
  • Get chemical ratings (r) 
  • Calculate overall rating and display (c) 
  • Exit (x) 

Display the menu and wait for the user’s response. 

Process the options entered until the user enters 'x' to quit. 

Using a switch statement organise the code to suit the option 

Option ‘m’: Get chemical details should do the following: 

Collect and store the following information from the user: 

  • Chemical Name 
  • Year purchased 
  • Supplier 
  • Quantity 
  • Cost 

Option ‘r’: Get chemical ratings should do the following: 

Collect and store the ratings: 

  • Toxicity (out of 10) 
  • Flammability (out of 10) 
  • Corrosiveness (out of 10) 
  • Explosive (out of 10) 
  • Harmful (out of 10)

Option ‘c’: Calculate overall rating and display (c) should do the following: 

Calculate the chemical rating using the following: 

  • Toxicity (out of 10) : 20% of overall rating 
  • Flammability (out of 10 : 20% of overall rating 
  • Corrosiveness (out of 10 : 14.5% of overall rating 
  • Explosive (out of 10) : 30% of overall rating 
  • Harmful (out of 10) : 15.5% of overall rating 

Output the results a follows: 

Chemical data 

Chemical Name : hydrofluoric acid 

Year purchased : 2016 

Supplier : Acme chemicals 

Quantity (L/Kg) : 3.5 

Cost : $35.65 

Rating 

Toxicity : 7 

Flammability : 6 

Corrosiveness : 4 

Explosive : 8 

Harmful : 7 

Overall rating is 7/10: ******* 

Option ‘x’: Exit (x) should do the following: 

Exit the program 

Notes: 

  • Your program should display appropriate informative prompts, retrieve the data from the keyboard and  check the data is valid then store each entry to be used to display output or used to calculate the overall  rating 
  • Where an error is detected in the data entry process, display an appropriate message then re-prompt the  user to enter the data again 
  • You need to ensure that the option ' Get chemical ratings (r) ' is not executed if the chemical details (m) have  not been entered 
  • You need to ensure that the option 'Calculate and display (c)' is not executed if the chemical details and  ratings (r) have not been entered 
  • Use a for loop to write the '*' character to the screen 
  • Ensure you place a comment at the top of the program that contains your full name and student number • Place comments in your code as required and ensure you layout your code appropriatelya 

Get your SIT102 C++ Initial Stage Programming "Create a new C# console application project in Visual Studio and name the project"  assignment solved by our C++ Programming Experts from Exam Question Bank . Our Assignment Writing Experts are efficient to provide a fresh solution to all question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing Style. Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered.

You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turn tin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

  • Uploaded By : Katthy Wills
  • Posted on : February 11th, 2023
  • Downloads : 0
  • Views : 155

Download Solution Now

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan

Premium

80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing
Most
Popular

Gold

30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%

Silver

20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more