0% found this document useful (0 votes)
49 views9 pages

Lab 1 SSK Programming Report

This document contains solutions for three Java programming problems involving unit conversion, calculating percentages, and simulating production costs. For each problem, the student analyzes the data and requirements, develops input-process-output charts and flowcharts, and writes pseudocode to describe the program logic. The solutions determine the necessary inputs and outputs and describe the processing steps to calculate the required values for each problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views9 pages

Lab 1 SSK Programming Report

This document contains solutions for three Java programming problems involving unit conversion, calculating percentages, and simulating production costs. For each problem, the student analyzes the data and requirements, develops input-process-output charts and flowcharts, and writes pseudocode to describe the program logic. The solutions determine the necessary inputs and outputs and describe the processing steps to calculate the required values for each problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

SSK3100

Lab 1: Pre-programming Phase (Problem Solving)

Name : Ahmad Naim Bin Ahmad Nazri


No. Matrics: 208213
Program: Bachelor Science In Materials Science with Honours

1. Write a solution for a Java program to read a number in feet as input, convert it to
meters, and displays the result to the users. (Formula: 1 foot = 0.305 meters.)

 Analyzing the problem

Data Processing Output

Length in feet Calculate meters Length in meters

 Develop IPO chart

Input Processing Method Output


Reference

Length in - Enter length Length in meters


feet - Meters = feet x 0.305
- Display length in meters
 Develop flowchart

start

read length in feet

meters = 0.305 x feet

print meters

end

 Pseudocode
Begin
Enter length
Meters = feet x 0.305
Display length in meters
End
2. An instructor calculates the percentages for grading his students based on the achieved
marks in exam. Based on the given maximum marks and a student’s marks by the user,
write a solution for a Java program to calculate and print the required percentage. (Hint:
Percentage = marks / maximum_marks * 100)

 Analyzing the problem

Data Processing Output

Mark Calculate percentage Percentage Mark

 Develop IPO chart

Input Processing Method Output


Reference

- Mark - Enter mark achieved Percentage mark


achieved - Enter maximum mark
- Maximu - Percentage = (mark /
m mark maximum mark) x 100
- Display percentage mark

 Develop flowchart
start

read mark achieved

read maximum mark

percentage = mark achieved / maximum mark) x 100

print percentage

end

 Pseudocode

Begin
Enter mark achieved
Enter maximum mark
Percentage = (mark / maximum mark) x 100
Display percentage mark
End

3. An electronics company produces circuit boards with the production cost, PC, for each
board. The profits that should be earned for each board is 40 percent from PC, so the
company needs to calculate the selling price, SP. Then they want to project simulation
for producing and selling N number of circuit boards, and calculate the profits that could
be earned. Write the solution of a Java program to help the company produce the
simulation/projection. Determine the suitable input and output values for your solution.

 Analyzing the problem

Data Processing Output

- Production cost - Calculate selling - Selling price


- Number of circuit price - Profits
boards - Calculate profits

 Develop IPO chart

Input Processing Method Output


Reference

- Productio - Enter production cost - Selling


n cost - Enter number of circuit price
- Number of boards - Total
circuit - Selling price = (0.4 x profits
boards production cost)+production
cost
- Profits = 0.4 x production
cost x number of circuit
boards
- Display selling price
- Display profits
- End

 Develop flowchart

start

read production cost


Selling price = (0.4 x production cost)+production
cost

 Pseudocode

Begin
Enter production cost
Enter number of circuit boards
Selling price = 1.4 x production cost
Profits = 0.4 x production cost x number of circuit boards
Display selling price
Display profits
End

You might also like