0% found this document useful (0 votes)
51 views2 pages

EXER01

The document describes two programming exercises: 1. Create a program that asks the user to input an initial velocity, final velocity, and time for a moving object. It then calculates and displays the object's acceleration and displacement. 2. Create a program that inputs a 5-digit number, extracts and outputs each digit, then outputs the digits in reverse order using a formula.

Uploaded by

Doreaama, Moel
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)
51 views2 pages

EXER01

The document describes two programming exercises: 1. Create a program that asks the user to input an initial velocity, final velocity, and time for a moving object. It then calculates and displays the object's acceleration and displacement. 2. Create a program that inputs a 5-digit number, extracts and outputs each digit, then outputs the digits in reverse order using a formula.

Uploaded by

Doreaama, Moel
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/ 2

CSS121L – Exercise #1

1. Displacement

Create a flowchart and pseudocode that will ask the user to enter the initial velocity and the
final velocity of a moving object in linear motion. Likewise, the program will also ask for the time
traveled by the object. Then, the program should be able to compute for the distance traveled.

Variables Used

Start 𝑣𝑓, 𝑣𝑖, 𝑡 are numeric

Begin

Accept 𝑣𝑓, 𝑣𝑖, 𝑡


𝑣𝑓−𝑣𝑖
input 𝑣𝑓, 𝑣𝑖, 𝑡 𝑎=
𝑡
Display “Acceleration” =, a
1
𝑆 = (𝑣𝑖)𝑡 + (𝑎)(𝑡2)
𝑣𝑓 − 𝑣𝑖 2
𝑎=

𝑡 Display “Displacement” =, 𝑆
End

output 𝑎

1
(𝑎)(𝑡2)

𝑆 = (𝑣𝑖)𝑡
2

output 𝑆

End
2. Extract the Digits

Create a flowchart and pseudocode that would input a 5-digit number and then extract its one’s
digit, ten’s digit, hundred’s digit, thousand’s digit and ten thousand’s digit. Output the extracted
digits and output the digits in reverse order (you must use a formula / arithmetic expression in
reversing the order of the 5-digit number). NOTE: Use appropriate words for your variables.

Variables Used x = number input

Start x, d are numeric d = digit

r = reverse

Begin

input Accept = x

if x > 0, then

d = x % 10

x = x / 10

False Display (d)


if
Else
x>0
End

True

d = x % 10

x = x / 10

output d

End

You might also like