Free Essay

Prelab Assignment Lab 5

In: Computers and Technology

Submitted By afrocdm
Words 471
Pages 2
ITCS 1212L

PreLab 5

Rational and equality operators, logical operators, conditional operators, conditional structures, selective structures, typecasting, and working with debuggers.

Learning Objectives:
● Practice more with if-else-if and switch statements.
● Understand the concept of scope
● Understand the difference between static, local and global variables
● Practice with functions that can return more than a value and whose parameters’ scopes are not local to the function
● Input validation

These pre-labs are directly related to the lab activities. You don’t need to complete the program. What you need to do is to work on the logic and perhaps some key parts of each program and then complete them in the lab.

Assigned: Date of your lab 4
Due: the night before lab 5

Questions Prelab activity for Lab 5A:
Find the difference between two types of returning values.
Implement the following function prototypes (which take hours of work as integer and the rate of pay as float and calculates the net-payment as float) on paper. Also, write a main function which calls both functions. Compare the calculated net values and show the proper message whether or not they match. Name your variables as hours, rate, and netPay.

float calNetPay(int, float); void calNetPay2(float&, int, float);

Also, answer the following questions:
What does the operator & do? Create a table and put all of the variables of the program inside the first column. The second column should show the scope of each variable. For example for calNetpay2 function if you called the integer variables hours, its scope will be the function calNetPay2.

Prelab activity for Lab 5B:

Create a flowchart showing the following scenario: 1. Present the user with a list of options, 1-3 with proper message as indicated below.
2. Get the user’s choice.
3. If it is one, show the max temperature for zipcode 28223.
4. If it is two, show the min temperature for zipcode 28223.
5. If it is three, exit the program.

Prelab activity for Lab 5C:
You saw the following menu-driven program before which determines the max and min temperatures. This time, it is a complete code to calculate the charges for a health club membership.

#include using namespace std;

// Function protoypes char showMenu(); double calculateMembershipRate(char, int); void displayMembershipRate(double);

int main()
// Declare variables char choice; // To hold menu choice int months; // To hold the number of months double membershipRate; // To calculate the membership rates

// Function call to display the menu and return the menu // choice choice = showMenu();

// Accept number of months and calculate membership rates if user chooses A, B or C if(choice != 'D') { // Get the number of months cout months;

// Make a function call to calculate the membership rates. Send choice, and months as parameters membershipRate = calculateMembershipRate(choice, months);

// Make a function call to display the final membership rate displayMembershipRate(membershipRate); } else { cout…...

Similar Documents

Free Essay

Lab 5

...Lab 5.1 The Condition | True or False | attAverage >= verizonAverage | True | tmobileAverage == 868 | True | verizonAverage < sprintAverage | False | sprintAverage != attAverage | True | Lab 5.2 The Condition | Expected Output | If tmobileAverage > 800 AND verizonAverage> 800 ThenDisplay “Both have average downloadrates over 800”ElseDisplay “One or both of the averagesare less”End If | Both average download Rates over 800 | If sprintAverage == 800 ThenDisplay “Sprints download rate is 800”End If | No display | If attAverage >= 1300 OR tmobileAverage>=900Display “Select either carrier”End If | Select either carrier | Lab 5.3 Main Module() //Declare variables on the next 3 lines Declare Integer testScore = 0 Declare String category = “ “ Declare String interview = “ “ //Make Module calls and pass necessary variables on the next 4 lines Call getScore(testScore) Call employCat(testScore, category) Call interviewPoss(testScore, interview) Call displayInfo(testScore, category, interview) End Main Module getScore(Integer Ref testScore) //Ask user to test score Display “Please enter test score” Input testScore End Module Module employCat(Integer testScore, String ref category) //Determine what employment category they are in based on their test score //Similar to if the score is less than 60, then category is “No” //Otherwise, if score is less than 70, then category is “Maybe” //…and so on if testScore => 85 then Set...

Words: 288 - Pages: 2

Premium Essay

Lab 5 It220

...LAB 5 IT220 Exercise 5.1.1 * The 802.1 standard defines the 802 family of standards, describes the local area network, and defines the LAN address format. Exercise 5.1.2 * The 802.3af standard originally defined PoE functionality. The standard was enhanced in the year 2009, the name of it is 802.3at. Exercise 5.1.3 * 500 meters * 185 meters * 100 meters * Fiber Optic * UTP, 100 Meters * UTP, 100 Meters * Multi-Mode-Fiber Optic, 550 Meters * Single Mode- Fiber Optic * UTP 4 Pairs, 100 Meters Exercise 5.1.4 * The numeric prefix before BASE means the speed in Mbps. The inclusion of a postfix of -T means that the cable is a twisted pair standard. Lab 5.1 Review 1. The maximum speed of traffic would be between 10Mbps, and 100Mbps because they would have to negotiate the amount of bandwidth to send the node in between the two different network standards. 2. It is possible by also using a negotiation to uphold the maximum speed of the lesser UTP wire for example if Cat3 and Cat5e had to negotiate the Cat5e would have to meet Cat3’s standard maximum speed. Exercise 5.2.1 * A MAC address must be unique for every NIC card produced because they are being compared to all other unicast MAC addresses in the same LAN. The effect would be that the MAC address would be duplicated. Exercise 5.2.2 * It gives information on the connection its physical address and DHCP status. Exercise 5.2.3 * The......

Words: 845 - Pages: 4

Free Essay

Week 5 Lab

...Wireless Spectrum Introduction This lab is going to be very interesting and challenging. We are being introduced to what, for some, is going to be the first time ever using a program that captures and records signals. We must then analyze them and use this as a tool to better be prepared to install and even troubleshoot our networks. My goal for this lab would be to gain a better understanding of this program and be able to recognize how it could be useful for me in my future endeavors. 1. Are any channels being used that overlap other channels? (10 points) It would appear that channels 1, 8 and 11 have the most use going on and that 8 and 11 overlap each other. 2. If you had to install a new wireless LAN, what channel would you use? (10 points) I would use something in the 3-6 range as it would provide the least amount of overlap with other channels. 3. What channels are being used? (10 points) It appears to me that channels 1, 5, and 11 are currently in use. 4. What channel is being used the most? (10 points) Channel 11 appears to have the most use going on on currently. 5. What type of signal is being shown? (10 points) The signal appears to match that of a HyperX RFID Reader. 6. What frequency, not channel, is being used? (5 points) The frequency in use is 2450 mhz. 7. What type of signal is being shown? (10 points) The signal being displayed is 802.11g. 8. How strong in dBms is this signal? (5 points) The signal strength......

Words: 461 - Pages: 2

Premium Essay

Physics Lab 5

...Lab Assignment 4: Types of Force Instructor’s Overview In many physics problems involving Newton’s laws of motion, you’ll see statements like, “assume a frictionless surface” or “neglecting air resistance…” In this lab we will be exploring both friction and air resistance, two resistive forces that are critical in the design of real-world products and systems. Understanding the effects of these types of forces is essential in the design of such things as aircraft, automobiles, braking systems, and countless other objects. This activity is based on Lab 4 of the eScience Lab kit. Although you should read all of the content in Lab 4, we will be performing a targeted subset of the eScience experiments. Our lab consists of two main components. These components are described in detail in the eScience manual. Here is a quick overview: * In the first part of the lab, you will measure the force it takes to pull objects of different mass. This experiment focuses on the effects of frictional forces. (eScience Experiment 1) * In the second part of the lab, you will investigate the effects of air resistance by performing controlled drops of coffee filters. Notes: * Please follow the instructions in this document for the air resistance experiment. * Record all of your data in the tables that are provided in this document. Take detailed notes as you perform the experiment and fill out the sections below. This document serves as your lab report. ......

Words: 1726 - Pages: 7

Premium Essay

Lab 5 will give you more information that all of the scans. It includes every port UDP and TCP. Plus you can enable different switches like operating system detection. This is an intrusive scan, so I guess if you where enumerating and trying to find out information about the network, you would use this. • Intense Scan – This is like the comprehensive scan. The intense scan is slow but not as slow as comprehensive. You can still run switches like operating system detection and version detection. 4. How many different tests (i.e., scripts) did your "Intense Scan" definition perform? List them all after reviewing the scan report. • It loaded 36 scripts, but I only saw a few performed. APR scan, SYN Stealth Scan, Service Scan, OS detection 5. Describe what each of these tests or scripts performs within the Zenmap GUI (Nmap) scan report. • ARP Ping Scan scanned to look for the machine • SYN Stealth Scan - Scans to see if the ports are open by sending a SYN packet if a packet is sent back, the port is open. If the port is closed, you would receive a different response. • Service Scan – Scans what services are available. • Detects operating system details 6. How many total IP hosts (not counting Cisco device interfaces) did Zenmap GUI (Nmap) find on the network? • It found 256 IP Addreses. 7. Based on your Nmap scan results and initial reconnaissance and probing, what next steps would you perform on the VSCL target machines?...

Words: 424 - Pages: 2

Premium Essay

Nt1230 Lab 5

...LAB 5 NT1230 5.1 5.2 Question 2 The result was “ this page can not displayed” Question 3 Intranet explorer could not open the page. Question 4 Page still could not be open. Question 5 •Make sure the web address http://ip_address is correct. •Look for the page with your search engine. •Refresh the page in a few minutes Question 6 It is important to clean caches before retesting the web server so it does not open the same cache if there was an error Question 7 The firewall was not letting it open till firewall was turned off Question 8 By testing on other sites with the firewall also turned off and on Question 9 You should not leave your firewall off because it protects your pc 5.3 Question 10 We allowed to open port 80 on HTTP Question 11 Port 4444 is not open 5.4 Question 12 (1) Use good anti virus softwares - To prevent computer from Viruses & other attacks. (2) Be aware of Phising & other social engineering tricks Question 13 The action are what differ from social to security Question 14 The rule we applied in exercise 13.3 applies only to Domain type network by default. So this rule allow connection to intranet inside your network only and will block all incoming connections from outside Public, Private. Question 15 The list was sorted by Domain profile rules. Question 16 On Profile page. Unchecking the Domain and Private checkboxes will prevent client access to the intranet website Question 17 The......

Words: 293 - Pages: 2

Premium Essay

Bio156 Lab 5

...oxygen. What is the primary energy molecule in cells? (5 points) ATP is the main energy molecule in cells and has a unique function as an energy transferor. This molecule contains nitrogenous base adenine connected to three molecules of phosphorus. The last 2 phosphates are high energy bonds. When ATP releases the terminal phosphate, energy is released while forming a new compound ADP. ADP can be remade with another phosphate to form ATP again List the equation in word and chemical form for each of the following processes: (6 points) Cellular respiration: C6H12O6  +  6O2 →  6CO2  +  6 H2O  +  36 or 38 ATP Alcoholic fermentation: C6H12O6  →  2CO2  +  2C2H5OH  +  2 ATP Lactic acid fermentation: Plant and fungal cells produce alcohol as a result of fermentation and animal cells produce lactic acid Does glycolysis require the presence of oxygen? Please explain your answer. (5 points) No, glycolysis does not require the presence of oxygen. It occurs in the cytoplasm of all cells. a single glucose molecule in glycolysis produces a total of 2 molecules of pyruvic acid, 2 molecules of ATP, 2 molecules of NADH and 2 molecules of water.  More ATP molecules are generated in step 7 and 2 more in step 10. This gives a total of 4 ATP molecules produced total with a final total of 2 ATP molecules remaining. Review the results from the Rate of Cellular Respiration and Exercise procedure of the lab (Part I) to answer the following questions. Why was......

Words: 964 - Pages: 4

Premium Essay

Cds344 Lab #5

...Lab #5 – Assessment Worksheet Performing Packet Capture and Traffic Analysis CDS344 - Information Security Course Name and Number: _____________________________________________________ Christian Tiell Student Name: ________________________________________________________________ Scott Blough Instructor Name: ______________________________________________________________ Lab Due Date: ________________________________________________________________ Overview In this lab, you used common applications to generate traffic and transfer files between the machines in this lab. You captured data using Wireshark and reviewed the captured traffic at the packet level, and then you used NetWitness Investigator, a free tool that provides security practitioners with a means of analyzing a complete packet capture, to review the same traffic at a consolidated level. Lab Assessment Questions & Answers 1. Why would a network administrator use Wireshark and NetWitness Investigator together? Wireshark - it is better at performing analysis NetWitness - it is better at performing captures 2. What was the IP address for LanSwitch1? 3. When the IP host responded to the ICMP echo-requests, how many ICMP echo-reply packets were sent back to the vWorkstation? 23 4. What was the terminal password for LanSwitch 1 and LanSwitch 2? Cisco 5. When using SSH to remotely access a Cisco router, can you see the terminal password? Why or why not? No, one could not view......

Words: 294 - Pages: 2

Premium Essay

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

Premium Essay

Is4550 Week 5 Lab

...------------------------------------------------- Week 5 Laboratory: Part 1 Part 1: Assess and Audit an Existing IT Security Policy Framework Definition Learning Objectives and Outcomes Upon completing this lab, students will be able to complete the following tasks: * Identify risks, threats, and vulnerabilities in the 7 domains of a typical IT infrastructure * Review existing IT security policies as part of a policy framework definition * Align IT security policies throughout the 7 domains of a typical IT infrastructure as part of a layered security strategy * Identify gaps in the IT security policy framework definition * Recommend other IT security policies that can help mitigate all known risks, threats, and vulnerabilities throughout the 7 domains of a typical IT infrastructure Week 5 Lab Part 1: Assessment Worksheet (PART A) Sample IT Security Policy Framework Definition Overview Given the following IT security policy framework definition, specify which policy probably can cover the identified risk, threat, or vulnerability. If there is none, then identify that as a gap. Insert your recommendation for an IT security policy that can eliminate the gap. Risk – Threat – Vulnerability | IT Security Policy Definition | Unauthorized access from pubic Internet | Acceptable use policy | User destroys data in application and deletes all files | Backup Recovery Policy | Hacker penetrates your IT infrastructure and gains......

Words: 1625 - Pages: 7

Premium Essay

Lab 5 Answer Sheet

...Lab 5 Nutrient Pollution – Answer Sheet The numbers in [brackets] indicate the corresponding question number in the lab notebook Exercise 2: P in the Water 18pts 1) [6.1] Fill in the data table below. (2pts) Input | Green Algae Population Size | Dissolved Oxygen (mg/L) | 1x | | | 2x | | | 3x | | | 2) [6.2] In Microsoft Excel (I’ve provided an Excel spreadsheet, but you are welcome to use the spreadsheet application of your choice: Google Sheets, OpenOffice, etc.) plot a line graph of your green algae population size data to show how green algae relate to phosphorus input levels. Think about which is the dependent and which is the independent variable. Be sure to label your axes. Copy your completed graph into the space below. (3pts) 3) [6.3] Does the relationship between green algae population size and phosphorus level indicate that phosphorus was a limiting nutrient for green algae in the lake? Explain in 4-5 sentences. (4pts) 4) [6.4] In Microsoft Excel (or spreadsheet application of your choice: see above), plot a line graph that shows how oxygen relates to phosphorus input level. Think about which is the dependent and which is the independent variable. Be sure to label your axes. Copy your completed graph into the space below. (3pts) 5) [6.5] What is the relationship between dissolved oxygen and phosphorus in the lake? State in 1-2 sentences. (2pts) 6) [6.6] Based on your two graphs, what is the relationship between green...

Words: 683 - Pages: 3

Premium Essay

Lab 5 Nt1310

...Lab 5 The biggest difference between these two types of networks is one uses network cables and one uses radio frequencies. A wired network allows for a faster and more secure connection and can only be used for distances shorter than 2,000 feet. Several other disadvantage of a wired network such as the “need to run cables in difficult environments through walls, floors and ceilings. Cables need to be run from computer to computer and switch to switch. Process can be time consuming. Loose cables likely remain the single most common and annoying source of failure in a wired network.” (PACE University, n.d.) While a wireless network is a very useful and convenient networking device, however these types of networks a lot less secure and transmission speeds can suffer from outside interference. Although wireless networking is a lot more mobile than wired networking the range of the network is usually 150-300 indoors and up to 1000 feet outdoors depending on the terrain. The cost for wired networking has become rather inexpensive. Ethernet cables, hubs and switches are very inexpensive. Broadband routers cost more, but these are optional components of a wired network, and their higher cost is offset by the benefit of easier installation and built-in security features. The primary parts of a wired network are the cables, network adapters, and routers. Wired LANs offer superior performance. The tools needed would be a Crimping tool, Punch Down tool, Cable cutters, Cable......

Words: 294 - Pages: 2

Premium Essay

Hands on Lab 5

...Hands-on lab week 5 March 25, 2016 20 integers change code to average 20 integers In order to change the number of integers it was only necessary to change the number of times the loop would run. This is because for each iteration of the loop it takes into account one integer. So I changed the condition to reflect 20 instead of 10 rounds. Test table Prepare 3 distinct cases 20 Integer Test Table Run Input Expected Output 1 Value 10 Value 20 Value 30 Value 40 Value 50 Value 60 Value 70 Value 80 Value 90 Value 5 Value 15 Value 25 Value 35 Value 45 Value 55 Value 65 Value 75 Value 85 Value 95 Value 100 52.5 2 Value 23 Value 6 Value 9 Value 12 Value 5 Value 10 Value 15 Value 20 Value 25 Value 2 Value 4 Value 6 Value 8 Value 10 Value 4 Value 8 Value 12 Value 165 Value 275 Value 2421 152 3 Value 1 Value 2 Value 3 Value 4 Value 5 Value 6 Value 7 Value 8 Value 9 Value 1 Value 2 Value 3 Value 4 Value 5 Value 6 Value 7 Value 8 Value 9 Value 1 Value 2 4.65 Changing Values try entering values other than an integer Here I tried entering the letters a-t and it returned a negative number. Next I tried using strings and finally floats. My results are in the screen shots below: Unspecified integers change code to average an unspecified number of integers This portion presented quite a bit of difficulty for me. I did not save all my variations of code as I assumed I would figure it out in time to......

Words: 500 - Pages: 2

Free Essay

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

Free Essay

Lab Assignment

...Lab Assignment No. 5 Topic: Inheritance Instructions: Write a program called bookstore.cpp that can read information of book, CDMusic, and DVDMovie from keyboard and then display all the information by its type: book, CDMusic, and DVDMovie. Specifications: Create a base class called Publication. The Publication class contains two member data: * title as an array of characters * price as float It also contains two member functions: * GetData() reads title and price from the keyboard. * DisplayData() displays title and price. Create a derived class called Book. The Book class is derived from Publication class. It contains the page_number as an integer. It also contains two member functions: * GetData() reads the page number from the keyboard. * DisplayData() displays the page number. Create a derived class called CDMusic. The CDMusic class is derived from Publication class. It contains the playing time as float type. It also contains two member functions: * GetData() reads the length of playing time in minutes from the keyboard. * DisplayData() displays the length of playing time in minutes. Create a derived class called DVDMovie. The DVDMovie class is derived from Publication class. It contains the rating as an array of characters. It also contains two member functions: * GetData() reads the rating type from the keyboard. * DisplayData() displays the rating type. In the main routine, the program will...

Words: 430 - Pages: 2