Raptor Final Output
Raptor Final Output
Laboratory 1
Output:
Conclusion: Upon entering any Value and divide it by 2, I used the formula V/2, For example I
entered a value which is 8, and then the answer must be 4, so my answer is therefore
correct.
Comment: The logic wasn’t so hard, so I don’t encounter any hardship in this situation, except
on
using the raptor flowchart for the first time.
5. Draw a flowchart or write pseudocode to represent the logic of a program that allows the user
to enter a value for one edge of a cube. The program calculates the surface area of one side of the
cube, the surface area of the cube, and its volume. The program outputs all the results.
Solution: sideArea=X^2
surfaceArea=6*AreaOneSide
Volume=X^3
Pseudocode Flowchart
Start
Input GET X
Set areaSide=X^2
Set surfaceArea=6*areaSide
Set Volume=X^3
Output “areaSide=” + areaSide
Output “surfaceArea=” + surfaceArea
Output “Volume=” + Volume
End
Output:
Conclusion: In getting the Output of this Logic, I must find the formula or solutions first, which
are side Area=X^2, surface Area=6*Area One Side, Volume=X^3, in order to arrive at the right
answer.
Comment: Knowing what are the solutions, this logic is somehow, a little bit easy.
6. Draw a flowchart or write pseudocode to represent the logic of a program that allows the user
to enter two values. The program outputs the product of the two values.
Solution: Product=Value1*Value2
Pseudocode Flowchart
Start
Input GET V1
Input GET V2
Set Product=V1*V2
Output “Product=” + Product
End
Product:
Conclusion: We all knew that, Product, when it comes to mathematics is defined as the number
or result of two or more numbers when you multiply it. So, entered 2 values and multiply
them, as required in a given Logic, for me to be able to get the product.
7.a Draw a flowchart or write pseudocode to represent the logic of a program that allows the user
to enter values for the width and length of a room’s floor in feet. The program outputs the area of
the floor in square feet.
Solution: Area of the Floor=Length*Width
Pseudocode Flowchart
Start
Input GET WiF
Input GET LiF
Set Area=WiF*LiF
Output “Area of the Floor=” + Area +
“Ft.^2”
End
Product:
Conclusion: Getting the area is easy when you already knew the formula, which its Length
multiply by its width.
Comment: I understand how to do it immediately.
7. b. Modify the program that computes floor area to compute and output the number of 6-inch
square tiles needed to tile the floor.
Solution: “roomArea=RW*LW
tileSquareFeet= (6/12) ^2
numOfTiles= roomArea/tileSquareFeet
Pseudocode Flowchart
Start
Input GET rL
Input GET Rw
Set roomArea=rW*rL
Set tileSquareFeet= (6/12) ^2
Set numOfTiles= roomArea/tileSquareFeet
Output “The number of tiles=” + numOfTiles
End
Product:
Conclusion: In number 7-a, we already knew how to get the area of the floor, and this number is
its continuation. It asked the number of 6-inch square tiles needed to tile the floor, so, I first
converted 6-inch square to feet then raised to 2 since it is area. After getting the room area and
tiles square Feet is can now get the number of tiles needed.
8. a Draw a flowchart or write pseudocode to represent the logic of a program that allows the
user to enter values for the width and length of a wall in feet. The program outputs the area of the
wall in square feet.
Solution: wallArea=Length*Width
Pseudocode Flowchart
Start
Input GET wW
Input GET wL
Set wallArea= Ww*wL
Output “The wall Area = “+ wallArea+ “Ft.^2”
End
Output:
Conclusion: Getting the wall area is easy when you already knew the formula, which is, Length
multiply by its width.
Comment: It wasn’t so hard.
8 b. Modify the program that computes wall area to allow the user to enter the price of a gallon
of paint. Assume that a gallon of paint covers 350 square feet of a wall. The program outputs the
number of gallons needed and the cost of the job. (For this exercise, assume that you do not need
to account for windows or doors, and that you can purchase partial gallons of paint.)
Solution: wallArea= Length*Width
numOfGallons=wallArea/350
Cost=numOfGallons*gP
Pseudocode Flowchart
Start
Input GET wW
Input GET wL
Input GET gP
Set wallArea=wW*wL
Set numOfGallons=wallArea/350
Set Cost=numOfGallons*gP
Output “The wall Area=” + wallArea+ “Ft.^2”
Output “The numOfGallons=” +numOfGallons
Output “Cost=” + Cost
Product:
Conclusions: After getting the wall area, we need to find the number of Gallons, which is wall
area divided by 350, which is the assumed space that a number of gallons can cover as
given by the Logic, then I get the Cost by multiplying the Number of gallons by the
assumed gallon price.
Comment: This Logic is somehow understandable.
8. c. Modify the program that computes paint cost to allow the user to enter the number of
doorways that do not have to be painted. Assume that each doorway is 14 square feet. Output the
number of gallons needed and the cost of the job.
Solution: wallArea= Length*Width, numOfGallons= wallArea/350, Cost=numOfGallons*gP
Pseudocode Flowchart
Start
Input GET wW
Input GET wL
Input GET gP
Input GET NoDW
Set wallArea=(wW*Wl) -(NoDW*14)
Set numOfGallons=wallArea/350
Set Cost=numOfGallons*gP
Output “The wall Area=” + wallArea
Output “The numOfGallons=” +numOfGallons
Output “Cost=” + Cost
End
Product:
Conclusion: This is a little bit similar to 8-a, but in finding the area I subtracted number of
doorways, and each of it has a measure of 14 ft, through that I arrive on the output.
Product:
Conclusion: In doing this, I looked on the internet, and find the current value of currency or the
exchange rate of USD (Us Dollar) to euro and to Japanese Yen (As of August 25, 2019).
Product:
Conclusions: The Formula is given on the problem/logic, which is, in order to get the sales
person
pay, we must add its basic salary to the product of total sales and his/her commission rate,
that’s why I arrive to my answer.
Comment: This is not so hard, but my head really aches. (haha)
11. A consignment shop accepts a product for sale and sets an initial price. Each month that the
item doesn’t sell, the price is reduced by 20 percent. When the item sells, the item’s owner
receives 60 percent of the sale price, and the shop gets 40 percent. Draw a flowchart or write
pseudocode to represent the logic of a program that allows the user to enter an original product
price. The output is the sale price, the owner’s cut, and the shop’s cut each month for the first
three months the item is on sale.
Solution: salePrice1= oP*1
salePrice2= salePrice1*.8
salePrice3= salePrice2*.8
ownersCut= salePrice1*.6
ownersCut= salePrice2*.6
ownersCut= salePrice3*.6
shopsCut= salePrice1*.4
shopsCut= salePrice2*.4
shopsCut= salePrice3*.4
(table is on the next page)
Pseudocode Flowchart
Start
Input GET oP
Set salePrice1= oP*1
Set salePrice2= salePrice1*.8
Set salePrice3= salePrice2*.8
Set ownersCut= salePrice1*.6
Set ownersCut= salePrice2*.6
Set ownersCut= salePrice3*.6
Set shopsCut= salePrice1*.4
Set shopsCut= salePrice2*.4
Set shopsCut= salePrice3*.4
Output “salePrice1=” +salePrice1
Output “salePrice2=” +salePrice2
Output “salePrice3=” +salePrice3
Output “ownersCut1=” + ownersCut1
Output “ownersCut2=” + ownersCut2
Output “ownersCut3=” + ownersCut3
Output “shopsCut1=” + shopsCut1
Output “shopsCut2=” + shopsCut2
Output “shopsCut3=” + shopsCut3
End
Product:
Conclusion: It was stated in the problem that in First three month there is a reduce by 20% for
the
item that is not sold, so on the first month the price is the original one, on the second
month it was decrease by 20 %, and the second month price was decreased by another
20%, when the items sells, the sale price each month was multiplied by 60% for owners
cut and 40% for the Shops Cut, through that I was able to get the amount of money they
get each of three months.
Comment: It is not so hard but, the process gave a thrill on this one.
12. A mobile phone app allows a user to press a button that starts a timer that counts seconds.
When the user presses the button again, the timer stops. Draw a flowchart or write pseudocode
that accepts the elapsed time in seconds and displays the value in minutes and seconds. For
example, if the elapsed time was 130 seconds, the output would be 2 minutes and 10 seconds.
Solution: ElapseTime/60
ElapseTime MOD 60
Pseudocode Flowchart
Start
Input ElapseTime
Set ElapseTime/60
Set ElapseTime MOD 60
Output “minutes=’ + minutes
Output “seconds=” + seconds
End
Product:
Conclusion: For me to be able to get the minutes when I entered time lapse in seconds, I divided
it by 60 (the decimal places in minutes will be disregarded/ignored), and I used MOD to get the
remainder for the seconds.