Free Essay

# Unit 6 Pt1420 Introprogramming

Submitted By dfrye7
Words 533
Pages 3
Delvon Frye
7/26/2016
PT1420
Unit 6 Assignment
Algorithm Workbench pg. 159 6-10
6. Select number
Case 1:
Display “You selected A.”
Case 2:
Display “You selected 2.”
Case 3:
Display “You selected 3.”
Case 4: Display “You selected 4.” Default:
Display “Not good with numbers, eh?”
End Select
7. If Speed 24 > and Speed < 56
Display “Speed is normal.”
Else
Display “Speed is abnormal.”
8. If points are < 9 and >51
Display “Invalid points.”
Else
9. Display “Valid points.”
Select testMonth
Case value_1:
Display “January has 31 days.”
Case value_2:
Display “February has 28 days.”
Case value_3:
Display “March has 31 days.”
Default:
Display “Invalid selection.” End select
10. If hours==10 THEN
Programming Exercises 5 and 8 pg. 160
5. Dim color1 as string
Dim color2 as string
Display (“Please enter two primary colors.”)
Display (“The color you made is Purple”) Else Display (“The color you made is Purple”) Else
Display (“The color you made is Orange”)
Else
Display (“The color you made is Orange”)
Else
Display (“The color you made is Green”)
Else
Display (“The color you made is Green”)
Else
If color1 = else or color2 = else then
Display (“You failed to enter a valid color!”)
End if

8. //This is a program asks the user to enter the number of coins required to make exactly one dollar.
//Declare the variables
Declare Real pennies
Declare Real nickels
Declare Real dimes
Declare Real quarters
Declare Real dollars
//Get input from the user
Display “Enter the number of pennies :” Input pennies Display “Enter the number of nickels :”
Input nickels
Display “Enter the number of dimes :” Input dimes
Display “Enter the number of quarters :”
Input quarters
//convert pennies, nickels, dimes, quarters to dollars
Set dollars = dollars + pennies S et dollars = dollars + (nickels * 5) Set dollars = dollars + (dimes * 10)
Set dollars = dollars + (quarters * 25
If dollars == 100 Then
Display “Congratulations for winning the game.”
Else
If dollars < 100 Then
Display “The amount entered was less than one dollar.”
Else
Display “The amount entered was more than one dollar.”
EndIf

1.You can create logic flows; in which is a method used to make the reading easier for the reader.
2.Because they are written in natural language, use cases are easy to understand and provide an excellent way for communicating with customers and users.
3.Static depth, in which “if” can be set to however amount the user wants.