0% found this document useful (0 votes)
8 views1 page

Csc01a1 2024 P2

The document outlines an assignment for a C++ program that includes basic selection operations such as switch-case, if-statements, and the conditional operator. The program presents a menu with two options: one for evaluating a machine learning model's accuracy and another for assessing the number of completed VPL exercises. It emphasizes user input validation, requires a design for Option B, and includes a mark sheet for grading various components of the submission.

Uploaded by

makoalatebogo5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Csc01a1 2024 P2

The document outlines an assignment for a C++ program that includes basic selection operations such as switch-case, if-statements, and the conditional operator. The program presents a menu with two options: one for evaluating a machine learning model's accuracy and another for assessing the number of completed VPL exercises. It emphasizes user input validation, requires a design for Option B, and includes a mark sheet for grading various components of the submission.

Uploaded by

makoalatebogo5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Practical 2 (due 2024-03-01 @ 09:00)

The purpose of this assignment is for you to start using basic selection operations, which
include the switch-case, if-statements and the conditional operator.

Write a C++ program so that, whenever the program runs, it presents the user with a menu to
select one of two options. The program stops after the selected option has finished executing.

Option A:
Ask the user to input the accuracy score of a machine learning model. Use the following table
to output an appropriate message based on the model's accuracy:
Accuracy (%) Message
[0 – 50] Low accuracy! Consider retraining the model.
(50 – 70] Moderate accuracy. Room for improvement.
(70 - 90] Good accuracy. Your model is performing well.
(90 – 100] Excellent accuracy. Well done!

Option B:
Ask the user to enter the number of VPL exercises they completed throughout the semester. If
the number of completed exercises is less than 5, output “The more VPL exercises you
successfully complete, the higher your chances of obtaining a perfect practical mark.” Else,
output “Keep it up.”

Instructions:
Write a C++ application that complies with the following instructions.
1. Make use of at least one switch-case structure
2. Make use of if-else statement
3. Make use of the conditional operator (?:)
4. User input validation needs to happen. You may exit the application if validation fails.
Validation is the process of ensuring that, if a number is expected, a number was
provided by the user. Additionally, if a positive number was expected, a positive number
was provided.
5. You must complete a design for Option B. A Microsoft Word design template that you
can use to complete the design is available on EVE.
6. The submission must include both the Source and Docs directories and the naming
convention must follow the standard described in the previous practical exercises.
7. Compare your submission with the mark sheet below to ensure you get marks for the
various sections.

Important: Student submissions will be tested for similarity. Student submissions that are too
similar to each other will receive zero marks.

Mark sheet
Code compiles 10
Main menu with two options 10
Option A execution 10
Option B execution 10
Validation in main menu, Option A and Option B inputs 10
switch-case statement 10
if-else statement 10
Conditional operator 10
Naming of variables, code indentation and comments 10
Design 10
Total /100

You might also like