Cis 170 ilab 2 of 7
Upcoming SlideShare
Loading in...5
×
 

Cis 170 ilab 2 of 7

on

  • 465 views

You will code, build, execute, debug, and test two programs using decision structures. The first program will calculate the shipping charge based on a given purchase amount. The second program ...

You will code, build, execute, debug, and test two programs using decision structures. The first program will calculate the shipping charge based on a given purchase amount. The second program translates a given TV channel to its call sign.
Deliverables
Submit the following to this week’s Dropbox:
A zipped Visual Studio project folder for each programming exercise. Refer to the Deliverables section of the Week 1 iLab page for detailed instructions on how to zip a project folder.
A single MS Word file named YourLastName_Lab1_ex1.docx containing the following items:
The source code for each program in the lab: Your source code should use proper indentation, include meaningful comments, and be error free. Start each with a specification that includes your name, the lab and exercise number, and a description of what the program accomplishes, similar to this: /* Specification:
First Name Last Name
Lab 1 Exercise #
This program does X */
Labeled screenshot(s) of the output windows for each program, showing that each program produces correct results
NOTE: A screenshot of a window can be created by first clicking on it to activate it. Next, press the key or key combination your specific computer uses to do a “print screen” (typically the Prnt Scrn or Prnt key in combination with the ctrl or FN key). Then, click the MS Word “paste” option to paste the screenshot into the MS Word file.

Statistics

Views

Total Views
465
Views on SlideShare
465
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Cis 170 ilab 2 of 7 Cis 170 ilab 2 of 7 Document Transcript

  • SOLUTIONJUG.COMCIS/170 - iLab 2 of 7Screenshot 1CLICK HERE TO GET THE SOLUTION !!!!!!!Scenario/SummaryYou will code, build, execute, debug, and test two programs using decision structures. The first program willcalculate the shipping charge based on a given purchase amount. The second program translates a given TVchannel to its call sign.DeliverablesSubmit the following to this week’s Dropbox:1. A zipped Visual Studio project folder for each programming exercise. Refer to the Deliverables section of theWeek 1 iLab page for detailed instructions on how to zip a project folder.2. A single MS Word file named YourLastName_Lab1_ex1.docx containing the following items: The source code for each program in the lab: Your source code should use proper indentation, includemeaningful comments, and be error free. Start each with a specification that includes your name, the laband exercise number, and a description of what the program accomplishes, similar to this: /* Specification:First Name Last NameLab 1 Exercise #This program does X */ Labeled screenshot(s) of the output windows for each program, showing that each program produces correctresultsNOTE: A screenshot of a window can be created by first clicking on it to activate it. Next, press the key orkey combination your specific computer uses to do a “print screen” (typically the Prnt Scrn or Prnt key incombination with the ctrl or FN key). Then, click the MS Word “paste” option to paste the screenshot intothe MS Word file.Objectives and GradingLab Objectives:1. To be able to design program logic using either a flowchart or pseudocode2. To be able to define and use data types3. To be able to prompt the user for input4. To be able to use the assignment statement for calculations5. To be able to display output to the console in a formatted manner6. To be able to debug a program of syntax and logic errors
  • 7. To be able to make decisionsYour lab grade will be based upon:1. the formatting of your source code;2. the use of meaningful identifiers;3. the extent of internal documentation; and4. the degree to which an exercise’s specifications are met.Preparation:If you are using the Citrix remote lab, follow the login instructions located in the iLab tab in Course Home.iLab 2Part A: Calculate Shipping ChargeRequirementsYour mission: Write a program that gets the amount of a purchase from the user and then calculates theshippingcharge, based on the following table:$0.00 – $250.00: $5.00$250.01 – $500.00: $8.00$500.01 – $1,000.00: $10.00$1,000.01 – $5,000.00: $15.00over $5,000.00: $20.00Sample output from program:Enter a purchase amount to find out your shipping charges.Please enter the amount of your purchase: 234.65The shipping charge on a purchase of $234.65 is $5.00.Press any key to continue . . .TipsBest practice: Put yourself in the place of the program. What questions would you ask a customer in orderto get thebest input? How would you determine the correct shipping charges if you had to make the decisionsyourself?Write out the questions you would ask yourself on paper as pseudocode and/or in Visual Studio as C#comments,and then implement them one by one, testing as you go. Remember to not write too much at onetime. Alwaysadd and test functionality incrementally!
  • You can use the pseudocode below as a guide:Prompt the user for the sale amountIs sale amount greater than $5,000.00?If so, shipping is $20.00If not, is sale amount greater than $1,000.00?If so, shipping is $15.00If not, is sale amount greater than $500.00?If so, shipping is $10.00If not, is sale amount greater than $250.00?If so, shipping is $8.00If not, is sale amount greater than $0.00shipping is $5.00If notshipping is $0.00If shipping is $0.00Display “Error incorrect input”If notDisplay sale amount and shipping chargePart B: TV Channel to Call SignRequirementsYour mission: Write a program that translates a TV channel (1 through 10) in your area to its respectivecall sign. For example, in the New York metropolitan area, channel 2 translates to WCBS. If a channel isunused in your area, tell the user that this is the case.Sample output from program:Translate TV Channel Number to Call SignEnter channel number: 1Channel 1 is undesignated in your areaEnter channel number: 2Call sign for channel 2 is WCBSEnter channel number: 6Call sign for channel 6 is WRNNDTTipsBest practice: Put yourself in the place of the program. What steps would you personally need to performin order to process a channel translation yourself? Write out those steps on paper as pseudocode and/or inVisual Studio as C# comments, and then implement them one by one, testing as you go. Remember to not View slide
  • write too much at one time. Always add and test functionality incrementally!Pseudocode: Although there are several valid ways to write the program, the following is an outline ofone way to design the overall logic. Declare variables for channel and call sign Get channel number from user Use appropriate decision structure to translate number to call sign If number is valid in area Print out translationIf not Tell user this is the caseFor instructions on how to use the Dropbox, read these Step-by-Step Instructions or watch this DropboxTutorial.Screenshot 1CLICK HERE TO GET THE SOLUTION !!!!!!! View slide