|
EXAMPLE NUMBER |
DESCRIPTION |
|
Enter two integers and display the sum. |
|
|
A program that computes the GST on a retail price. |
|
|
Converts kilograms to pounds. |
|
|
Converts dollars to Canadian dollars. |
|
|
Converts inches to centimeters. |
|
|
Illustrates how using literal spaces are not an acceptable way to format. |
|
|
Illustrates how to RHJ (Right Hand Justify) two integers. |
|
|
Illustrates how to add headings to your output. |
|
|
Illustrates how to format decimal numbers. |
|
|
Allows the user to enter the average temperature, and the average rainfall. |
|
|
Confirming that two methods can produce the same output. |
|
|
Illustrates the result of integer division. |
|
|
Illustrates the use of integer division and the modulo operator. Converts hours/minutes to total minutes. |
|
|
Calculates the earned run average for a pitcher. |
|
|
Illustrates how a variable value can be overwritten. |
|
|
Illustrates how the assignment of a float value to an "INT" variable causes truncation. |
|
|
Illustrates that numeric variables of mixed types can be used in an arithmetic expression. |
|
|
Test your understanding of type conversion. Can you predict the output of this program? |
|
|
Allows the user to enter 3 exam scores and finds their average. Forces float division. |
|
|
Converts degrees Celsius to Fahrenheit, displaying the result to the nearest degree. |
|
|
Calculates the balance after one year of earning interest compounded twice yearly. |
|
|
Illustrates how to format strings. |
|
|
Illustrates how to position a string value after a numeric value. |
|
|
Illustrates how to position a numeric value after a string value. |
|
|
Allows the user to enter a name, street address, city, postal code, # of hours worked, and hourly pay rate. Calculate gross and net pay along with taxes. |
|
|
Converts pounds to kilograms or kilograms to pounds. |
|
|
Illustrates how a non-zero condition makes the "IF" block of code execute while a zero condition makes the "ELSE" block of code execute. |
|
|
Write a program that allows the user to enter the rainfall total for July. Part 1 of 2. |
|
|
Checks to see if the entered rainfall amount is within the normal range of 24mm and 11mm. Part 2 of 2. |
|
|
Compute the tax, according to table based on the user's taxable income. |
|
|
Finds the larger of two numbers entered by the user. |
|
|
Converts military time into standard time. |
|
|
Write a program that allows the user to enter in the date in the form of year, month, day. Converts numeric date (i.e. 1998 11 23) to combination alpha-numeric (Nov 23, 1998). |
|
|
Determines a maximum load value depending on the purchase price and credit rating. |
|
|
Converts a given month into a season. |
|
|
Illustrates how you cannot trust a test for equality that involves a float or double. |
|
|
Illustrates how you cannot trust a test for equality that involves a float or double. |
|
|
Calculates the balance after one year of earning interest compounded a certain number of times. |
|
|
Modifies Ex411.cpp so that the user enter the term of the interest calculation as well as the number of compounds per year. |
|
|
Calculates the balance after one year of earning interest compounded 12 times annually. |
|
|
Calculates the balance after one year of earning interest compounded 12 time annually. User enters the initial balance and yearly interest as a percent. |
|
|
Same as 411 and 412, but the balance at the end of the month is displayed and the interest is accumulated and displayed as well. |
|
|
Calculates the interest earned and balance for a monthly deposit. |
|
|
Shows how to use an exit controlled loop to validate an integer that must be between 1 and 10. |
|
|
Shows how to use cursor control to create a simple data entry screen with 2 numeric validations. |
|
|
Does the same as 421 but uses cursor controls to enhance the input presentation. |
|
|
Modifies 424.cpp so that the integers entered are validated to be positive and less than 1,000. |
|
|
Illustrates how to use an exit controlled loop to give the user the execution control over the program. |
|
|
|
|
|
Allows the user to enter any number of integers until a sentinel value of -999 is entered. Calculates the sum and average of those numbers entered. |
|
|
This program contains an infinite loop. **** WARNING: DO NOT RUN THIS PROGRAM FROM THE BORLAND IDE. INSTEAD, COMPILE AND LINK THE CODE, THEN RUN THE EXE FILE FROM THE EXPLORER. |
|
|
This program calculates and displays how many years of earning interest it will take in order to increase a balance from the starting value to an ending value. |
|
|
Stores integers input from the keyboard in an array, then prints out the integers 3 per line. |
|
|
Allows the user to enter up to 20 names. Displays the names in reverse order. |
|
|
The user enters a set of data for each employee. One employee has a name Together with an hourly rate and hours worked. After all the data is entered, the program calculates and displays the gross pay for each employee. |
|
|
Uses a bubble sort to sort an array of strings. |
|
|
Uses a bubble sort to sort an array of integers. |
|
|
Replaces all occurrences of "+" with a blank in a string. |
|
|
Modifies 532.cpp so that the original array is edited. No second array is used. |
|
|
Creates a new array that contains only the positive integers from an array Assume that the array is not larger than 20 integers. |
|
|
Merges two sorted arrays into one sorted array. |
|
|
Extracts sub-strings delimited by a "*" out of a large string. The sub-strings are copied to an array of a string. |
|
|
Creates a data entry screen for inventory. Each inventory item has an inventory number, quantity, and description. |
|
|
Modifies 541.cpp so that the display of the inventory is sorted by inventory number. |
|
|
|
|
|
Same as Ex521.cpp except that we use an array of char instead of the string class in order to represent strings. |
|
|
This program is a modification of 511.cpp so that the user cannot exceed the capacity of the array. |
|
|
Allows the user to enter any positive number and displays its square root. |
|
|
Calculates the monthly mortgage payment using the calculations: Principal*MonthlyRate*Calc1/(Calc1-1). |
|
|
This program has a function that accepts two integers and returns their sums. |
|
|
Uses a function to validate the range if an integer. This program only performs validated input. No output is attempted. |
|
|
A function is used to calculate the standard deviation of an array of integers. The array is initialized instead of input from the user. |
|
|
|
|
|
Illustrates how formal parameters are paired with actual parameters and that the formal parameters take on the values of their corresponding actual parameters. |
|
|
Illustrates the effects of changing the values of formal parameters. |
|
|
Illustrates how the pass by value mechanism is an important design feature when we create a function. |
|
|
This program illustrates that arrays are not passed by value. |
|
|
This program shows how to pass an array to a function and restrict the function's access to read only. |
|
|
This program shows how to pass a parameter by reference. We start with an array of integers. The function AppendData appends integers to the array and updates the size of the array. Note the second parameter in the function AppendData. |
|
|
Rewrite 541.cpp so that the data entry and display processes are housed in functions. |
|
|
This program is used in the project 656.ide. It allows a larger array to be used. |