After I take attendance, I'll answer any questions you have about operators. I'll then post the quiz, as promised.
After you finish the quiz, you'll have the rest of the class to work on the coin program.
After your program is complete, be sure to upload main.cpp from the coin project using both your and your partner's last name.
.
Thursday, August 28, 2008
Operator Quizlet
Post a comment to this blog answering the following questions (copy & paste the questions):
.
- State the purpose of ++
- State the difference between = and ==
- State the result of 14 % 3
- State the operator which expresses not equal to
.
Operator, are you there?
We're going to learn about operators today.
Copy and paste the following into a comment to this blog. After each operator, provide a definition for it. Submit the comment after today's lecture.
Mathematical:
+
-
/
*
%
++
--
Assignment:
=
Comparison:
<
>
<=
>=
!=
Boolean:
&&
||
Copy and paste the following into a comment to this blog. After each operator, provide a definition for it. Submit the comment after today's lecture.
Mathematical:
+
-
/
*
%
++
--
Assignment:
=
Comparison:
<
>
<=
>=
!=
Boolean:
&&
||
Wednesday, August 27, 2008
program from yesterday
/* Mr. Howard
pizza program
program to be used at a pizza joint cash register */
#include
using namespace std;
int main()
{
int menu_choice;
float cost;
char answer;
do
{
do
{
cout << "******** MENU ********\n"; cout << "1) Small Pizza\n"; cout << "2) Large Pizza\n"; cout << "3) Breadsticks\n"; cout << "4) Dozen Wings\n"; cout << "5) Jojo's\n"; cout << "6) Calzone\n"; cout << "7) Soda 2litre\n\n"; cout << "Please choose your item: "; cin >> menu_choice;
if (menu_choice == 1)
{
cost = cost + 8.75;
}
else if (menu_choice == 2)
{
cost = cost + 11.25;
}
else if (menu_choice == 3)
{
cost = cost + 3.50;
}
else if (menu_choice == 4)
{
cost = cost + 7;
}
else if (menu_choice == 5)
{
cost = cost + 4.5;
}
else if (menu_choice == 6)
{
cost = cost + 9;
}
else if (menu_choice == 7)
{
cost = cost + 2.25;
}
else
{
cout << "Invalid choice. Try Again.\n"; } cout << "Would you like to add more items? (y/n) "; cin >> answer;
} while(answer == 'y');
pizza program
program to be used at a pizza joint cash register */
#include
using namespace std;
int main()
{
int menu_choice;
float cost;
char answer;
do
{
do
{
cout << "******** MENU ********\n"; cout << "1) Small Pizza\n"; cout << "2) Large Pizza\n"; cout << "3) Breadsticks\n"; cout << "4) Dozen Wings\n"; cout << "5) Jojo's\n"; cout << "6) Calzone\n"; cout << "7) Soda 2litre\n\n"; cout << "Please choose your item: "; cin >> menu_choice;
if (menu_choice == 1)
{
cost = cost + 8.75;
}
else if (menu_choice == 2)
{
cost = cost + 11.25;
}
else if (menu_choice == 3)
{
cost = cost + 3.50;
}
else if (menu_choice == 4)
{
cost = cost + 7;
}
else if (menu_choice == 5)
{
cost = cost + 4.5;
}
else if (menu_choice == 6)
{
cost = cost + 9;
}
else if (menu_choice == 7)
{
cost = cost + 2.25;
}
else
{
cout << "Invalid choice. Try Again.\n"; } cout << "Would you like to add more items? (y/n) "; cin >> answer;
} while(answer == 'y');
Tuesday, August 26, 2008
Pizza Continued. DunDunDuuuun...
First, we're going to be finishing the program from yesterday. Good fun.
Then we're going to learn about operators. [note- no at&t employees will be harmed during this lesson]
.
Then we're going to learn about operators. [note- no at&t employees will be harmed during this lesson]
.
Pepperoni Pie in Your Eye
Goal #1: I want you to transfer all your msvc++ projects to your flashdisk. That means remove them from "My Documents" and onto your flashdisk. Subsequent projects will all be saved there.
Goal #2: Learn the super-useful "if" statement.
Goal #3: We're going to write a program which could be used by a pizza joint to total up a customer's order. The program must have at least 7 menu items with prices. The user must be able to add multiple items to the customer's order. At the end of the order, the program should show the total cost (with the associated 5.5% sales tax [dine-in obviously]). After that customer's order is totaled, the program should repeat so that more orders can be taken for new customers. We'll write the pseudocode for this program together. This is due at the end of class tomorrow.
.
Goal #2: Learn the super-useful "if" statement.
Goal #3: We're going to write a program which could be used by a pizza joint to total up a customer's order. The program must have at least 7 menu items with prices. The user must be able to add multiple items to the customer's order. At the end of the order, the program should show the total cost (with the associated 5.5% sales tax [dine-in obviously]). After that customer's order is totaled, the program should repeat so that more orders can be taken for new customers. We'll write the pseudocode for this program together. This is due at the end of class tomorrow.
.
Monday, August 25, 2008
if (Good Day == Guten Tag) {you = german;}
Last week, we wrote our first program, hello world.
We're going to pick up right where we left off. Go ahead and get msvc++ fired up and start a new project.
Today's task is to write a program which prompts the user for a radius and calculates circumference, area, and volume for circular shapes.
.
We're going to pick up right where we left off. Go ahead and get msvc++ fired up and start a new project.
Today's task is to write a program which prompts the user for a radius and calculates circumference, area, and volume for circular shapes.
.
Subscribe to:
Comments (Atom)