Free Essay

Unit 6 Pt1420 Introprogramming

In:

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
Unit 6 Research Assignment: Advantages and Disadvantages of using Case Structures

Advantages:
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.
4.Low CPU overhead.
5.You can insert certain captions using “< >//”
6.As a user-centered technique, use cases help ensure that the correct system is developed by capturing the requirements from the user's point of view.
Disadvantages:
1.If it is case specific, in which a case can’t be re-used.
2.If it is static, in which the user will not be able to create most implements.
3.The “Bloated syntax” takes space, in which case is more functional when used in an equation.
4.It takes a lot of maintenance, because for any change requires fixing throughout the entire structure.
5.Most programmers use it; which means that whatever you’re.

Similar Documents