In WINDOWS:
- Snap your windows to left and right so you can code and read the program description simultaneously.
- Use the Lock feature to always keep your desktop active (unless the computer shuts down).
- Drag the Lazarus icon into the menu bar so you can access it often.
- Create a Desktop Shortcut for your CP1 folder on your student server for easy access.
In LAZARUS:
- Always title your programs by the name on the website (for example, MyFirstProgram).
- ALWAYS open New Project >> Simple Program, then Save Project As in its OWN NEW FOLDER on your STUDENT-FILE server folder.
- To open old code while another project is open:
- Press CTRL-O while in Chrome/Firefox. Navigate to the STUDENT-FILE server and find the desired program folder. Open the HTML file you submitted in the dropbox for that program.
- You can copy and paste from this file without a loss in formatting, color, etc.
- Use the Recent Projects feature in your Project Menu to recall recent files.
- Disable SmartTabs by going to Tools >> Options then, along the left bar, Tab and Indent
- Modify code colors by going to Tools >> Options then, along the left bar, Colors. HOWEVER--DO NOT USE WHITE OR LIGHT GRAY FOR ANYTHING.
IN INDIVIDUAL .EXE FILES
- Change height and width by right-clicking on menu bar and selecting properties.
- Change font colors by right-clicking on menu bar and selecting properties.
- These settings hold until you change them, even if you move to new Lazarus projects
1D PROGRAMSExcellence (6 points): Complete Cuber, PaintRoom, and TenConversions within 50 hours. Programs must be easy to read and use.
Advanced (5 points): Complete Cuber, PaintRoom by beginning of Day 5, and TenConversions by end of Unit 1. Programs must be easy to read and use. Proficient (4 points): Complete Cuber and PaintRoom by end of Unit 1. Programs must be easy to read and use. Basic (3 points): Complete Cuber by end of Unit 1. Below Basic (2 points): Attempt Cuber. |
|
THIS MODULE'S ALBUMS: |
Cuber
Recall the process for making a new project:
Write a program that asks the user for a real number, cubes the given number, and displays the result to two decimal places (not in scientific notation).
Your program must ask for the input in a complete sentence and explain the output in a complete sentence. Dropbox the program when you are finished. Don't forget to export as HTML from the File menu.
Below is "Test Data". In most programs, I will provide you with examples of input and the outputs you should get so you can test your program. However, you should ALWAYS test at least once with other data--particularly those "oddities" that might make your program break. For example, it would be good to test negatives, zero, and larger numbers in this program in addition to the ones that I have given you.
TEST DATA:
INPUT OUTPUT
2 8.00
3.32 36.59
100 1000000.00
Recall the process for making a new project:
- Project Menu: New Project>> Simple Program.
- Project Menu: Save Project As >> Create a folder on your U-drive (student-file) named "Cuber" >> Save file as "Cuber"
Write a program that asks the user for a real number, cubes the given number, and displays the result to two decimal places (not in scientific notation).
Your program must ask for the input in a complete sentence and explain the output in a complete sentence. Dropbox the program when you are finished. Don't forget to export as HTML from the File menu.
Below is "Test Data". In most programs, I will provide you with examples of input and the outputs you should get so you can test your program. However, you should ALWAYS test at least once with other data--particularly those "oddities" that might make your program break. For example, it would be good to test negatives, zero, and larger numbers in this program in addition to the ones that I have given you.
TEST DATA:
INPUT OUTPUT
2 8.00
3.32 36.59
100 1000000.00
PaintRoom
Write a program to determine how much paint will be needed to paint the four walls and ceiling of a room in the shape of a rectangular prism. The width, length, and height of the room will be the inputs (in feet). For your calculation, do not deduct anything for windows or doors, and do not paint the floor. The program should output:
TEST DATA:
W = 8, H = 8, L = 12 >>> Area of 416 square feet and use 1.66 cans of paint.
L = 15, W = 10, H = 9 >>> Area of 600 square feet and use 2.40 cans of paint.
Write a program to determine how much paint will be needed to paint the four walls and ceiling of a room in the shape of a rectangular prism. The width, length, and height of the room will be the inputs (in feet). For your calculation, do not deduct anything for windows or doors, and do not paint the floor. The program should output:
- The width, length, and height (see the diagram to tell which is which) with an appropriate label to go with the numbers.
- The area you are painting (in square feet) with a label.
- The number of cans of paint you’ll need (to two decimal places) with a label.
TEST DATA:
W = 8, H = 8, L = 12 >>> Area of 416 square feet and use 1.66 cans of paint.
L = 15, W = 10, H = 9 >>> Area of 600 square feet and use 2.40 cans of paint.
TenConversions
Write a program that will ask the user for his/her favorite integer. In the background, convert that number (listed as x below) into another value based on some common and not so common conversions. You need a total of ten conversions; I give you eight, you develop two of your own. You will need to scour the internet to find the conversion rates needed.
Your output should include a complete sentence including both the original and converted value, along with labels. For example: "Did you know that --- pounds of coffee beans could make --- cups of coffee?"
Your output values must also be sensible (whole or real) given the unit of measure. For example, a conversion of inches to centimeters could be a decimal (2 inches = 5.08 cm) but a conversion of a number of people to the number of baseball teams of 9 they could make would need to be a whole number (56 people = 6 full baseball teams).
With variables of type real, the :0:2 after the variable will give it two decimal places. Use :0:0 to give it zero (it will round to the nearest integer).
To round down, use the function trunc(variable);. For example, new_value := trunc(value); will make new_value = 5 if value = 5.72.
Please round to the nearest whole number or go to two decimal places (2 DP) based on the indication at the end of each line.
CONVERSIONS LIST
x = degrees Fahrenheit to Celsius (2 DP)
x = U.S. Dollars to Mexican Pesos (use the current rate from the XE currency converter, output to 2 DP)
x = hours to minutes (Whole Number)
x = miles to feet (Whole Number)
x = gallons to pints (Whole Number)
x = pounds of apples to bushels (2 DP)
x = number of men to barbershop quartets (Whole Number)
x = children in a town to the number of mothers in that town (on average)...use this site's map function for the U.S. (Whole number)
You choose
You choose
TEST DATA:
INPUT = 11
OUTPUTS
1) -11.67 degrees Celsius
2) Varies depending on the exchange rate, but probably around 200-250.
3) 660 minutes
4) 58080 feet
5) 88 pints
6) Varies depending on your choice, but should be around 0.20-0.30 bushels.
7) 2 barbershop quartets
8) 6 mothers.
9) Varies; check it yourself.
10) Varies; check it yourself
Write a program that will ask the user for his/her favorite integer. In the background, convert that number (listed as x below) into another value based on some common and not so common conversions. You need a total of ten conversions; I give you eight, you develop two of your own. You will need to scour the internet to find the conversion rates needed.
Your output should include a complete sentence including both the original and converted value, along with labels. For example: "Did you know that --- pounds of coffee beans could make --- cups of coffee?"
Your output values must also be sensible (whole or real) given the unit of measure. For example, a conversion of inches to centimeters could be a decimal (2 inches = 5.08 cm) but a conversion of a number of people to the number of baseball teams of 9 they could make would need to be a whole number (56 people = 6 full baseball teams).
With variables of type real, the :0:2 after the variable will give it two decimal places. Use :0:0 to give it zero (it will round to the nearest integer).
To round down, use the function trunc(variable);. For example, new_value := trunc(value); will make new_value = 5 if value = 5.72.
Please round to the nearest whole number or go to two decimal places (2 DP) based on the indication at the end of each line.
CONVERSIONS LIST
x = degrees Fahrenheit to Celsius (2 DP)
x = U.S. Dollars to Mexican Pesos (use the current rate from the XE currency converter, output to 2 DP)
x = hours to minutes (Whole Number)
x = miles to feet (Whole Number)
x = gallons to pints (Whole Number)
x = pounds of apples to bushels (2 DP)
x = number of men to barbershop quartets (Whole Number)
x = children in a town to the number of mothers in that town (on average)...use this site's map function for the U.S. (Whole number)
You choose
You choose
TEST DATA:
INPUT = 11
OUTPUTS
1) -11.67 degrees Celsius
2) Varies depending on the exchange rate, but probably around 200-250.
3) 660 minutes
4) 58080 feet
5) 88 pints
6) Varies depending on your choice, but should be around 0.20-0.30 bushels.
7) 2 barbershop quartets
8) 6 mothers.
9) Varies; check it yourself.
10) Varies; check it yourself
ABC: CramersRule (+2 points)
Cramer's Rule (see Figure 1) is a mathematical algorithm used to solve a system of two linear equations. It uses numerical matrices and a concept known as the determinant to assist you in solving. It's a total pain to complete by hand, but it fits quite nicely into a computer program!
These 2x2 matrices shown in the straight-bar notation (like absolute value) are asking you to find the determinant of each matrix (see Figure 2).
Write a program that allows the user to input the coefficients and constants of two linear equations and solves for x and y using Cramer's Rule.
TEST DATA:
INPUT: x + 2y = 5 and 2x - y = 0
OUTPUT: x = 1, y = 2
Cramer's Rule (see Figure 1) is a mathematical algorithm used to solve a system of two linear equations. It uses numerical matrices and a concept known as the determinant to assist you in solving. It's a total pain to complete by hand, but it fits quite nicely into a computer program!
These 2x2 matrices shown in the straight-bar notation (like absolute value) are asking you to find the determinant of each matrix (see Figure 2).
Write a program that allows the user to input the coefficients and constants of two linear equations and solves for x and y using Cramer's Rule.
TEST DATA:
INPUT: x + 2y = 5 and 2x - y = 0
OUTPUT: x = 1, y = 2