Pt1420 Lab 5

In: Computers and Technology

Submitted By ejbd90
Words 462
Pages 2
PT1420T
LAB 5.1 – 5.5
Lab 5.1 attAverage >= verizonAverage TRUE tmobileAverage == 868 TRUE verizonAverage < sprintAverage FALSE sprintAverage != attAverage TRUE
Lab 5.2
Expected Output
Both have average download rates over 800
Nothing
AT&T
Lab 5.3
Main Module()
//Declare variables
Declare Integer testScore = 0
Declare String category = “NO VALUE ”
Declare String interview = “NO VALUE ”
//Make Module calls and pass necessary variables
Call gettestScore()
Call employCat()
Call interviewPoss()
Call displayInfo()
End Main
Module gettestScore(Integer Ref testScore)
//Allows the user to enter the test score
Display “Please input test score:”
Input gettestScore
Display (“The interviewee’s test score is:” , gettestScore)
End Module
Module employCat (Integer gettestScore, String Ref category)
//Determines the employment category
If gettestScore >= 85 Then
Category = “Definitely”
Else
If gettestScore > 70 AND testScore =< 84 Then
Category = “Likely”
Else
If gettestScore > 60 AND testScore =< 69 Then
Category = “Maybe”
Else
If gettestScore =< 59 Then
Category = “No”
End If
End Module
Module interviewPoss(Integer gettestScore, String Ref interview)
//Determine if they qualify for an interview based on their test score
//Similar to if the score is less than 60, then interview is “No”
//Otherwise, interview is “Yes”
If gettestScore < 60
Interview = “No”
Else
Interview = “Yes”
End If
End Module
Module displayInfo(Integer gettestScore, String category, String interview)
//Displays the gettestScore, category, and interview variables
Display “Test score is:” gettestScore
Display “Category is:” category
Display “Interview is:” interview
End Module
Lab 5.4

The test score is 90
The employment category is Definite
Interview?…...

Similar Documents

Lab 3 Pt1420

...Lab 3.1 Step 1: Variable Name | Problem (Yes or No) | If Yes, what’s wrong? | Declare Real creditsTaken | No | | Declare Int creditsLeft | Yes | Int should be real | Declare Real studentName | Yes | Real should be string | Constant Real credits needed = 90 | Yes | Credits needed should be one word | Step 2: There is no Set keyword used prior to the equation Should be Set creditsLeft = creditsNeeded - creditsTaken Step 3: The student’s name is Nolan Owens Step 4: This program requires 90 credits and they have taken 20 credits so far. Step 5: 1. //Provide documentation on line 2 of what this program does 2. //This program calculates the credits the student has left before graduation 3. //Declare variables on lines 4, 5, 6, and 7 4. Declare Real creditsTaken 5. Declare Real creditsNeeded 6. Declare Real creditsLeft 7. Declare String studentName 8. //Ask for user input of studentName and creditsTaken on line 9 - 12. 9. Input studentName 10. Input degreeName 11. Input creditsNeeded 12. Input creditsTaken 13. //Calculate remaining credits on line 14 14. Set creditsLeft = creditsNeeded - creditsTaken 15. //Display student name and credits left on line 16 and 17 16. Display “The student’s name is”, studentName 17. Display “This means there are”, creditsLeft, “left until graduation.” Lab 3.2 Lab 3.3 Module Module1 Sub Main() 'local variables used in this program Const......

Words: 275 - Pages: 2

Pt1420 Lab 8

...Lab 8.1 Step 2: The hour is 1 continue loop till the hour is 24 then stop. Step 3: Constant Integer Max_Minutes = 60 Declare Integer minutes For minutes = 1 to Max_Minutes Display “The minute is “, minutes End For Step 4: Constant Integer Max_Seconds = 60 Declare Integer seconds For seconds = 1 to Max_Seconds Display “The second is “, seconds End For Step 6: The number is 2 The number is 4 The number is 6 The number is 8 The number is 10 Step 7: Constant Integer Max_VALUE = 200 Declare Integer counter For counter = 20 to Max_VALUE step 20 Display “The number is “, counter End For Step 9: Enter the number of students in class Display however many numbered students you enter Step 11: Loop five times, each asking you to enter a number Displaying the total at the end Step 12: Declare Integer counter Declare Integer totalAge = 0 Declare Real averageAge = 0 Declare Integer age Declare Integer number Display “How many ages do you want to enter: “ Input number For counter = 1 to number Display “Enter age “ Input age Set totalAge = totalAge + age End For averageAge = totalAge / number Display “The average age is “, averageAge Lab 8.2 Lab 8.3 Module Module1 Sub Main() Dim anotherDay As String = "yes" While anotherDay = "yes" Dim totalSpeed As Double = 0 Dim averageSpeed As Double = 0 enterSpeeds(totalSpeed) calcAverage(totalSpeed, averageSpeed) ...

Words: 324 - Pages: 2

Pt1420 Assignment Unit 5

...Assignment Unit 5 Short Answer 1. Explain what is meant by the term “conditionally executed”. Conditionally executed is called a single alternative decision structure because it provides only one alternative path of execution. The action is conditionally executed because it is performed only when a certain condition is true. 2. You need to test a condition and then execute one set of statements if the condition is true. If the condition is false, you need to execute a different set of statements. What structure will you use? I will use the “If” statement because it is a dual alternative decision structure. 3. If you need to a test the value of a variable and use that value to determine which statement or set of statements to execute, which structure would be the most straightforward to use? The case structure lets the value of a variable or an expression determine which path of execution the program will take. 4. Briefly describe how the AND operator works. The AND operator takes two Boolean expressions as operands and creates a compound Boolean expression that is True only when both sub-expressions are true. 5. Briefly describe how the OR operator works. The OR operator takes two Boolean expressions as operands and creates a compound Boolean expression that is true when either of the sub-expressions is true. The following is an example of an If-Then statement that uses the OR operator: 6.When determining whether a number is...

Words: 332 - Pages: 2

Pt1420 Lab 01

...Lab 1: Introduction to Computers and Programming This lab accompanies Chapter 1 of Starting Out with Programming Logic & Design. Name: Rhamses Graterol Lab 1.2 – Using Visual Basic IDE Help Video: Double click the file to view video This lab requires you to use the IDE (Integrated Development Environment) to create a project workspace using Visual Basic 2005. Step 1: Launch Visual Basic 2005. Click on File, then New Project. In the template window, select Console Application. In the Name box, enter a name for your program. Click OK to create your workspace. [pic] Step 2: Save your program. Click on File, then Save All. You can choose your workspace location. Click Save. [pic] Step 3: All programming code will go inside Main( ). This is automatically inserted into your workspace so you are ready to code. Copy and paste below the code that shows up in your window. Module Module1 Sub Main() End Sub End Module Step 4: Click on File, and Exit your program. Be sure to click Save All if it is not saved. Step 5: Launch Visual Basic again. When you open a previously created workspace, click File, then Open Project. In order to open all the files associated with your workspace, you must open the .sln file. Find that, and click Open. [pic] If the code window does not show, click View, then Solution Explorer. Double Click on Module1.vb. That is the name of the code file,......

Words: 795 - Pages: 4

Pt1420 Lab 4

...Lab 4-1 Module main () //Declare local variables 1. Declare String clientName 2. Declare Real feetUTP 3. Declare Real subTotal 4. Declare Real taxCost 5. Declare Real totalCost //Module calls 6. Module inputData () 7. Module calcCosts() 8. Module displayBill() End Module //this module takes in the required user input. There will be a display and input for each variable Module inputData(Real Ref feetUTP, String Ref clientName) 9. Display “Enter Client name” 10. Input clientName 11. Display “Number of feet of UTP installed” 12.Input feetUTP End Module //this module calculates subTotal, taxCost, and totalCost you also need feetUTP passed in to calculate //subTotal Module calcCosts(13. , , , ) 14. subTotal = feetUTP *.21 15. taxCost = subTotal*.06 16.totalCost = taxCost+subTotal End Module //this module displays clientName and totalCost Module displayBill (17. , ) 18.Display “The client name is ”clientName 19. Display “The final cost is “totalCost End Module Lab 4-2 Lab 4-3 Module Module1 Sub Main() Dim clientName As String = "NO VALUE" Dim feetUTP As Double = 0 Dim subTotal As Double = 0 Dim taxCost As Double = 0 Dim totalCost As Double = 0 inputData(clientName, feetUTP) calcCost(feetUTP, subTotal, taxCost, totalCost) finalBill(clientName, totalCost) Console.Write("Press enter to continue...") Console.ReadLine() End Sub Sub......

Words: 395 - Pages: 2

Pt1420 Lab 5.5

...1.  Sub Main() 2.         Dim testScore As Integer = 0 3.         Dim category As String = " " 4.         Dim interview As String = " " 5.   6.         getScore(testScore) 7.         employCat(testScore, category) 8.         interviewPoss(testScore, interview) 9.         displayInfo(testScore, category, interview) 10.   11.         Console.WriteLine("Please hit enter to exit...") 12.         Console.ReadLine() 13.           'Daniel Merritt (17486170) 14.     End Sub 15.   16.     Private Sub getScore(ByRef testScore As Integer) 17.         Console.WriteLine("Enter the score: ") 18.         testScore = Console.ReadLine() 19.     End Sub 20.   21.     Private Sub employCat(ByVal testScore As Integer, ByRef category As String) 22.         If testScore <= 59 Then 23.             category = "No" 24.         ElseIf testScore <= 69 And testScore >= 60 Then 25.             category = "Maybe" 26.         ElseIf testScore <= 84 And testScore >= 70 Then 27.             category = "Likely" 28.         ElseIf testScore >= 85 Then 29.             category = "Definite" 30.         End If 31.     End Sub 32.     Private Sub interviewPoss(ByVal testScore As Integer, ByRef interview As String) 33.         If testScore <= 59 Then 34.             interview = "No" 35.         ElseIf testScore <= 69 And testScore >= 60 Then 36.      ...

Words: 255 - Pages: 2

Pt1420 Unit 3 Lab

...Lab 3.1 Step 1: Variable Name | Problem (Yes or No) | If Yes, what’s wrong? | Declare Real creditsTaken | No | | Declare Int creditsLeft | Yes | Int should be real | Declare Real studentName | Yes | Real should be string | Constant Real credits needed = 90 | Yes | Credits needed should be one word | Step 2: There is no Set keyword used prior to the equation Should be Set creditsLeft = creditsNeeded - creditsTaken Step 3: The student’s name is Nolan Owens Step 4: This program requires 90 credits and they have taken 20 credits so far. Step 5: 1. //Provide documentation on line 2 of what this program does 2. //This program calculates the credits the student has left before graduation 3. //Declare variables on lines 4, 5, 6, and 7 4. Declare Real creditsTaken 5. Declare Real creditsNeeded 6. Declare Real creditsLeft 7. Declare String studentName 8. //Ask for user input of studentName and creditsTaken on line 9 - 12. 9. Input studentName 10. Input degreeName 11. Input creditsNeeded 12. Input creditsTaken 13. //Calculate remaining credits on line 14 14. Set creditsLeft = creditsNeeded - creditsTaken 15. //Display student name and credits left on line 16 and 17 16. Display “The student’s name is”, studentName 17. Display “This means there are”, creditsLeft, “left until graduation.” Lab 3.2 Lab 3.3 Module Module1 Sub Main() 'local variables used in this program Const......

Words: 275 - Pages: 2

Pt1420 Lab 7

...Lab 7.1 Module main () Declare String keepGoing = “y” While keepGoing == “y” Declare String clientName = “ “ Declare Real feetUTP = 0 Declare Real subTotal = 0 Declare Real taxCost = 0 Declare Real totalCost = 0 Call inputData (feetUTP, clientName) Call calcCosts (feetUTP, subTotal, taxCost, totalCost) Call displayBill (clientName, totalCost) End While End Module Lab 7.2 Lab 7.3 Module Main() Declare integer toPower = 2 Declare integer number = 2 Declare integer counter = 0 While Counter < 7 Set toPower = 2^Number Display 2 to the power of, “number,” is,”toPower,” Counter += 1 Number += 1 End While End Module Lab 7.4 Lab 7.5 Module Module1 Sub Main() Dim keepGoing As String = "yes" Do While keepGoing = "yes" pingMe() Console.Write("Enter yes if you want to run program again") keepGoing = Console.ReadLine() Loop Console.WriteLine("Press enter to continue. ..") Console.ReadLine() End Sub Sub pingMe() Dim counter As Integer = 5 Do While counter > 0 Console.WriteLine("Count down . ") counter = counter - 1 Loop Console.WriteLine("Now ping. ..") Shell("Ping.exe 127.0.0.1", , True) Console.Out.WriteLine(" ") End Sub End Module Lab 7.6 Module Module1 Sub Main() Dim keepGoing As String = "y" ...

Words: 262 - Pages: 2

Pt1420 Lab 3

...LAB 3.1 Variable Name | Problem (Y or N) | If Yes, what’s wrong? | Declare Real creditsTaken | No | | Declare Int creditsLeft | Yes | The variable should be declared as Real so it can indicate decimal values | Declare Real studentName | Yes | The variable should be a String to store text | Constant Real creditsNeeded = 90 | No | | Step 2: The calculation should be “creditsLeft = creditsNeeded – creditsTaken” Step 3: “The student’s name is Nolan Owens” Step 4: “The Network Systems Administration degree is awarded after 90 credits and Nolan Owens has 70 left to take before graduation.” Step 5: 1. //Provide documentation on line 2 of what this program does 2. //This program calculates how many credits a student still needs to graduate the NSA program 3. //Declare variables on lines 4, 5, 6, and 7 4. Declare Real creditsTaken = 0 5. Declare Real creditsLeft = 0 6. Declare String studentName = “NO VALUE” 7. Declare Constant Real creditsNeeded = 90 8. //Ask for user input of studentName and creditsTaken on line 9 - 12. 9. Display “What is the student’s name?” 10. User input = studentName 11. Display “How many credits does the student have?” 12. User input = creditsTaken 13. //Calculate remaining credits on line 14 14. creditsLeft = creditsNeeded – creditsTaken 15. //Display student name and credits left on line 16 and 17 16. Display “The student’s name is “, studentName 17. Display “They require “,......

Words: 458 - Pages: 2

Pt1420 7 1 Lab

...Unit 7 lab Short Answer Module main () // Declare variable Declare String clientName Declare Real feetUTP=0 Declare Real subtotal=0 Declare Real totalCost=0 Declare String keepgoing=“y” Display “Do you want to make a call?” Type y for yes. Input keepgoing While keepgoing == “y” // Module Calls Call Call Call End Module 7.2 7.3 // Declare loop control variable Declare Integer toPower=2 Declare Integer number=2 Declare Integer counter=0 Do ToPower=number^2 Display “2 to the power of”, number, “is” toPower Counter=counter+1 Number=number+1 While counter < 8 Lab7.4 Declare integer counter = 1 Declare integer toPower = 2 Declare integer number = 2 counter < 7 Display “2 to the power of”, number, “is”, toPower counter = counter + 1 False toPower = 2 ^ number True   Lab7.5 Module Module1 Sub Main() Dim keepGoing As Integer = 1 Dim Count As Integer = 5 pingMe() openWebsite() finalOutput() While Count > 0 Console.WriteLine("Count down ..." & Count) Count -= 1 End While Console.ReadLine() End Sub Sub pingMe() Shell("Ping.exe 127.0.0.1", , True) End Sub Sub openWebsite() Dim myTargetURL As String = "http://www.microsoft.com" System.Diagnostics.Process.Start(myTargetURL) End Sub Sub finalOutput() Console.WriteLine("Complete and explanation of what this program does.") Console.WriteLine("The Shell function and ping.exe check for a response from the web......

Words: 298 - Pages: 2

Lab 5

...Name: Date: Instructor’s Name: Assignment: SCI103 Phase 1 Lab Report Title: Measuring pH Levels Instructions: Enter the Virtual Lab, and conduct the experiments provided before going out into the virtual field for additional research. Please type your answers on this form. When your lab report is complete, submit it to the Submitted Assignments area of the Virtual Classroom. Part I: Answer the following questions while in the Phase 1 lab environment. Section 1: You will be testing 4 known solutions for pH levels using a standard wide-range indicator. Based off of the results obtained in the lab room, fill in the following table: |Solution Number |pH from Lab |Acid, Base or Neutral? |Solution Name (what was in the test tube?) | |Solution 1 |6 |Acid |Pure Water | |Solution 2 |1 |Acid |Lemon Juice | |Solution 3 |12 |Base |Bleach | |Solution 4 |5 |Acid |Coffee | 1. How many drops of wide range indicator will you use for each test, based on industry standards......

Words: 696 - Pages: 3

Pt1420 Lab 10

...Lab 10: File Access This lab accompanies Chapter 10 of Starting Out with Programming Logic & Design. Lab 10.1 – File Access and Visual Basic This lab examines how to work with a file by writing Visual Basic code. Read the following programming problem prior to completing the lab. Write and design a simple program that will take 3 pieces of data and write it to a file. Create variables and set them equal to the appropriate values: Declare string firstName = “xxx” Declare string lastName = “xxx” Declare integer age = your age Write this information to a file called myRecords.txt. Next, read this information from the file and print it to the screen. Step 1: Create a new Visual Basic workspace and add the following code: Module Module1 Sub Main() Dim firstName As String = "XXXX" Dim lastName As String = "XXX" Dim age As Integer = #### Dim writer As System.IO.StreamWriter = System.IO.File.CreateText("myRecords.txt") writer.WriteLine(firstName & " " & lastName & " " & age) writer.Close() Dim reader As System.IO.StreamReader = System.IO.File.OpenText("myRecords.txt") Dim myInfo As String = reader.ReadLine() Console.WriteLine(myInfo) reader.Close() 'this causes a pause so you can see your program Console.Write("Press enter to continue...") Console.ReadLine() End Sub End Module Step 2: Change......

Words: 347 - Pages: 2

Pt1420 Lab 6

...Elizabeth Thomas PT1420 Lab 6 February 1, 2016 Lab 6.1 Declare Integer mobileProvider = 0 Declare Integer dataOption = 0 Declare Boolean dataPackage = True Module inputOptions (Ref Integer mobileProvider, Ref Integer dataOption, Ref Boolean dataPackage) Display “Enter 1 for ATT, 2 for Sprint, and 3 for Verizon” Input mobileProvider Display “Enter 1 if you want a data package, or 2 if you do not.” Input dataOption If dataOption ==1 Then Display “True” Else Display “False” End if End Module Module displayProvider(Ref Integer mobileProvider) Select displayProvider Case 1: Display “You selected ATT.” Case 2: Display “You selected Sprint.” Case 3: Display “You selected Verizon.” Case 4: Display “You did not enter a valid option.” End Module Get mobileProvider (1== ATT, 2== Sprint, 3== Verizon) Get dataOption (1== data package, 2== no data package Get dataPackage (True OR False) If mobileProvider== 1 AND If dataPackage== True THEN Display (“You have selected ATT with a data package”) Else If mobileProvider== 2 OR If dataPackage== True THEN Display (“You have selected Sprint or you have selected with a data package.”) Else If mobileProvider== 3 AND If dataPackage== False THEN Display (“You have selected Verizon and no data package.”) End If 6.2 Module Module1 Sub Main() Dim mobileProvider As Integer = 0 Dim dataOption As Integer = 0 Dim dataPackage As Boolean = True ...

Words: 429 - Pages: 2

Pt1420 Lab 2.2

...Lab 2.2 Variable Name | Problem (Yes or No) | If Yes, what’s wrong? | Declare Real creditsTaken | No | | Declare Int creditsLeft | Yes | Int should be Real | Declare Real studentName | Yes | Real should be string | Constant Real Credits Needed = 90 | Yes | Credits needed should not have a space | What is wrong with the following calculation? Set creditsLeft = creditsTaken – creditsNeeded It needs to show how many credits you start off with and then minus what was taken and then equal what is left. Write the exact output you would expect from the following line of code if the user of the program enters “Nolan Owens” (Display “The student’s name is “, studentName) The students name is Nolan Owens Write the exact output you would expect from the following line of code if the user of the program enters a name of Nolan Owens and they have taken 20 credits so far. (Display “The Network Systems Administration degree is awarded after 90 credits and “, studentName, “ has “, creditsLeft, “ left to take before graduation.”) The Network Systems Administration degree is awarded after 90 credits and Nolan Owens has 10 left to take before graduation. Complete the following pseudocode to solve the programming problem 1. //Provide documentation on line 2 of what this program does 2. //This program determines how many credits student Nolan Owens has to acquire before graduation. 3. //Declare variables on lines 4, 5, 6, and 7 4. Declare Real creditsLeft = 2 5...

Words: 309 - Pages: 2

Lab 5

... c.s. * Prepared slide of mature lily anther (pollen grains), c.s. * Mature pollen * Glass slide * Coverslip * Compound microscope * 0.5% sucrose, in dropping bottle * Prepared slide of lily ovary, c.s megaspore mother cell * Compound microscope * Bean fruits * Soaked bean seeds * Iodine solution(I2KI), in a dropping bottle * Herbarium mount of Capsella, with fruits Procedure: Refer to Biology lab manual, lab 5- pages 3-7. Results: Questions: 1. Gymnosperms | Angiosperms | | | a.cones | flowers | c.Bare, not enclosed; found on scales, leaves or as cones. | Enclosed inside an ovary, usually in a fruit. | b. seed | Endosperm | 2. Pollination is the act of transferring pollen from the male part of a flower to the female part of a flower. Fertilization occurs when the male gamete of any sexually reproducing organism combines with a female gamete to form a zygote. 3. A. receptacle B. c.ovary D. filament E. stigma 4. It is a monocotyledon. 5. A. anther pollen tetrad B. pollen sacs...

Words: 362 - Pages: 2