Week 1 How To Solve Programming Problems

Week 1 How To Solve Programming Problems - 1 How To Solve...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Label2 Label1 Label3 Button1 Textbox 2 Textbox1 A VB Assignment Statement Label1 Textbox1 Button1 Label2 How To Solve Programming Problems This reading will help you solve the programming problems you will do in the weekly discussions. Please read it thoroughly before making your first post in the threaded discussions which require you to solve programming word problems. Input, Output and Processing All programs accept data in the form of input, alter that data through calculations or some form of processing, and then display the results to the user as output. Problems which require the program to “Get” information, “Ask” the user for information, or “Prompt” the user represent input steps. Processing happens in the form of instructions or “code” which the programmer writes the program. Processing usually refers to mathematical calculations or making decisions, such as deciding if a person qualifies for a credit card. Problems which indicate the program must “Calculate”, “Convert”, “Determine”, “Multiply”, “Add” or perform other calculations are referring to processing. Output can take a number of forms, such as information displayed to the user on the computer screen, and print-out of some kind, or data written to a database for a file. Problems which require the program to “Display” or “Print” information are output steps. Programmers often use Input, Processing and Output (IPO Charts) to organize the data that goes into a program, the processing that must occur, and the data that goes out; this helps them understand the problem. Later, it helps them design the VB form with which the user will interact. Here is a sample problem, and a corresponding IPO Chart. Example: Calculating Day Care Expense Write a program that gets the number of weeks in the summer and the amount you have to pay for child care in each week (assume the amount of is the same for each week). Then the program multiplies the number of weeks by the amount of child care you have to pay, arriving at the total daycare expense for the summer. Then the program displays the total daycare expense to the user. Example 1: IPO Chart Solution Input Processing Output Number of Weeks Weekly ChildCare Expense Multiply the Number of weeks by the weekly childcare expense Total Childcare Expense This program has two inputs – number of weeks, and the childcare amount. These steps are considered input because they are preceded by the keyword “Gets” in the problem statement. The processing is simply multiplying the weeks by the amount, suggested by the word “multiplies” in the problem statement. The output is simply the total daycare expense, indicated by the word “displays”. In the threads, you can also represent the IPO chart this way:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/27/2009 for the course BIS 311 taught by Professor Marshburn during the Fall '08 term at DeVry Cincinnati.

Page1 / 15

Week 1 How To Solve Programming Problems - 1 How To Solve...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online