Fundamentals of Programming Practical Assessment Guide
Institutional and Assessment Overview
Institution: The Rift Valley National Polytechnic.
Department: Information and Communication Technology (ICT).
Course Codes: L6CS-25M, L6CS-25S.
Assessment Title: Understand Fundamentals of Programming – Practical Assessment.
Academic Year: ) 2026.
Instructions to Candidates:
Candidates must attempt all tasks provided in the paper.
The assessment must be completed within the stipulated time.
The paper consists of two distinct practical tasks.
Practical 1: This task is to be completed on paper.
Practical 2: This task requires the use of a JAVA compiler.
Saving Convention: The Java program must be saved as
Main.java.
Problem Scenario: Retail Shop Program
Location: A small retail shop situated at Kabasis Centre.
Objective: To develop a simple program that assists the shopkeeper in calculating the total amount a customer should pay when purchasing a specific type of item.
Operational Flow:
The program prompts the user to input the name of the item (e.g., Milk).
The program prompts the user to input the unit price of the item in Kenya Shillings (e.g., ).
The program prompts the user to input the quantity or number of items being purchased (e.g., ).
The program performs the required calculation.
The program displays the item name and the resulting total cost back to the user.
Technical Logic and Formulas
Required Inputs:
Item Name ()
Unit Price ()
Quantity ()
Mathematical Formula for Total Cost:
Currency Representation: Kenya Shillings (Ksh).
Practical 1: Program Design Requirements
Allocation: .
Task: Design a solution for the shopkeeper's scenario showing the logic from start to finish.
Allowed Methodologies (Choose one):
Flowchart: A graphical representation of the program's logic.
Algorithm: A step-by-step descriptive process.
Pseudocode: Structural code-like representation.
Mandatory Design Elements:
Explicit representation of the "Start" of the program.
Clear indication of the three inputs: item name, unit price, and quantity.
A dedicated step for the calculation of the total cost.
A step for the display of results to the user.
Explicit representation of the "End" of the program.
Practical 2: Java Implementation Requirements
Allocation: .
Task: Translate the design from Practical 1 into a functional Java program.
Structural Constraints:
The code must be contained within a class named
Main.The program must feature a correctly implemented
public static void main(String[] args)method.Input handling must utilize the
Scannerclass from thejava.utilpackage.
Functional Requirements:
Implement logic to read item name, unit price, and quantity from the user.
Perform the calculation according to the provided formula.
Display the output including the item name and formatted total cost.
The code must compile successfully and execute without runtime errors.
Expected Sample Output and Behavior
Execution Example:
User prompt:
Enter item name:User input:
MilkUser prompt:
Enter unit price:User input:
70.00User prompt:
Enter quantity:User input:
2Resulting Display:
Item: MilkResulting Display:
Total Cost: Ksh 140.00
Calculation Trace: