0% found this document useful (0 votes)
27 views6 pages

Revsion Tutorial

1. The document provides instructions for students to complete a programming assignment in Java and submit it through the electronic campus system. 2. It describes two questions - the first asks students to develop an application that determines a person's marital status based on a code, and the second asks students to create an application that calculates final marks for 20 students based on test and exam scores. 3. Detailed instructions are provided on setting up folders to save work, accessing the electronic campus system, navigating to the correct test, and submitting answers by copying code into the system.

Uploaded by

Lesley Wiseman
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)
27 views6 pages

Revsion Tutorial

1. The document provides instructions for students to complete a programming assignment in Java and submit it through the electronic campus system. 2. It describes two questions - the first asks students to develop an application that determines a person's marital status based on a code, and the second asks students to create an application that calculates final marks for 20 students based on test and exam scores. 3. Detailed instructions are provided on setting up folders to save work, accessing the electronic campus system, navigating to the correct test, and submitting answers by copying code into the system.

Uploaded by

Lesley Wiseman
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/ 6

FACULTY: INFORMATION & COMMUNICATION TECHNOLOGY Revison

DEPARTMENT: COMPUTER SCIENCE


SUBJECT: Principles of Programming and Introduction to Programming (Java)
PPB115D/PPG115D/PPBF115D/PPGF15D
Tutorial
Instructions

 When you are done, follow the instructions on how to upload. Save
your work frequently.

 Add your name as a comment to the top and the bottom of your files.

Revision Assignment
Duration: 55 minutes Examiner
Due Date: 01 August 2023 Miss V.M. BOOI
Total: 30
Pages: 6
INSTRUCTIONS ON HOW TO WRITE THE TEST ON ELECTRONIC CAMPUS (EC):

1. Create a folder on D:\ Drive and rename the folder your student number.
2. Save all your work in the folder you have created
3. Open a text editor (notepad++ is recommended) or MS Word and save your document in your student number folder.
4. Open the browser.
5. Type http://ec.tut.ac.za in the address field of the browser and press enter.
6. Click Login.
7. Type in student number for user name and if you are using EC for the first time you must use your student number as your password. (Not
applicable any more. Please change to the current situation).
8. Alternatively, you must enter your password. (Same here).
9. Click Login button.
10. Click [Continue]
11. Select [Student]
12. Select [Tests]
13. Select [Webtest 4]
14. Type or Select PPB115D/PPG115D/PPBF15D/PPGF15D into the first text field.
15. Type or Select 20232 into the second text field.
16. Type or Select Z into the third text field (The “Z” must be a capital letter).
17. Click "Next"
18. Click on the "Write" button.
19. Click on "[Start]" and you will be in the test to submit your answers.
20. Click on [Section] on the test to submit each Questions, and click [Go] to submit your answer- Copy your answer and paste it in the space provided.
21. Click [Test] to move to the next or previous Questions.
22. Under each question click edit to update your answer.
Question 1 Selection [20 Marks]

Instructions
Log on to EC and proceed to the correct test. Select Section 1 and provide your answers to
this question therein.

Preparations
 Create a folder in the D drive called “D:\My Documents\StudentNumber\Question1\”,
where StudentNumber is your actual student number.
 Create a new file in Notepad++ called “MaritalStatus.java”. Open the file and complete
the question as instructed below.

Marital Status Application


Develop a Java application that will prompt a person’s marital status code and then display
the description or the marital status of that person. Determine the description of the user’s
marital status using the marital status code as indicated in the table below. Display the
messages as indicated in Figure 1.1. NB: Use a switch in your selection.

Marital Status Code Description


S/s Single
M/m Married
D/d Divorced
C/c Civil Partnership
Table 1.1: Marital Status

Figure 1.1
import java.util.Scanner;

public class A
{
public static void main(String[] args)
{
// Create a scanner object
Scanner input = new Scanner(System.in);
B description;

System.out.print("Enter your marital status:");

C grade = D ;

switch( E )
{

F
description = "Single";

description = "Married";

description = "Divorced";

description = "Civil Partnership";

A
description = "Invalid Marital status";
}

System.out.print("Your marital satus is "+ description);

}
}
Question 2 For Loop [10 Marks]
Instructions
Log on to EC and proceed to the correct test. Select Section 2 and provide your answers to
this question therein.

Preparations
 Create a folder in the D drive called “D:\My Documents\StudentNumber\Question2\”,
where StudentNumber is your actual student number.
 Create a new file in Notepad++ called “DetermineFinalMark.java”. Open the file and
complete the question as instructed below.

Determine Final Mark Application


Develop a Java application that will accept the following for 20 students: The students
name and 3 test marks, as well as one exam mark. The program must calculate the final
mark for every student. The final mark comprises of 50% of the exam mark added to 50% of
the average of the 3 tests. Display the final mark for every student.

See Sample output below.

Figure 2.1

When you are done with the assignment, use instructions above to submit:-

Due date: 01 August 2023 Time: 23:59

You might also like