Simple example of cash register program

Posted 11 July 2008 - 06:01 AM

Please Please help me with a simple cash register pragram. Assume that the store only has 5 items and all items are sold by weight. Select 5 of your favorite products to use in the program and give the store whatever name you like. Prompt the user of the program to enter the price per pound for each of the 5 products. After all of the prices have been entered printout a simple listing of each product and today’s prices. (“Here is what is available today:”)

Replies To: Simple example of cash register program

Re: Simple example of cash register program

Posted 11 July 2008 - 06:32 AM

Well you must show at least a tad of effort here, we won't do your homework for you but maybe you just need a push in the right direction:

Pseudo-code

#include <iostream>
using namespace std;
int main() {
cout << "***Welcome to Random Store***"<<endl <<endl;
cout << "Choose from the items below: " <<end;
//List items here
//You could make if statements pertaining to the weight of the //particular item. Just as easily you could use a switch //statement.
//Please try and put forth a bit more effort to this
return 0;
}

Re: Simple example of cash register program

Well you must show at least a tad of effort here, we won't do your homework for you but maybe you just need a push in the right direction:

Pseudo-code

#include <iostream>
using namespace std;
int main() {
cout << "***Welcome to Random Store***"<<endl <<endl;
cout << "Choose from the items below: " <<end;
//List items here
//You could make if statements pertaining to the weight of the //particular item. Just as easily you could use a switch //statement.
//Please try and put forth a bit more effort to this
return 0;
}

Re: Simple example of cash register program

Posted 13 July 2008 - 08:38 PM

Hello to all and thanks for any help still a bit confused please help me. Here is what I have so far.

/********************************************************************************************************************************************
*Craig Hull
*Programming Concepts, POS/370
*July 13, 2008
********************************************************************************************************************************************/
//This mini program was built for WK3 individual assignment for POS/370
/*The concept of this program is to create a fairly simple grocery store cash register program. With 5 items and all items sold by weight
This program will allow Publix's to prompt the user to enter the price per pound for each of the 5 products. After all of the prices
have been entered printout a simple listing of each product and today’s prices. (“Here is what is available today:”)*/
#include <iostream>
#include <stdio.h>
int main()
{
/*This first section of the program is using the scanf function to ask the end use to provide prices on five produces products*/
cout << "***Welcome to Publix's***"<<endl <<endl;
cout << "Choose from the items below:"<<end;
float fApple=.0;
float fOrange=.0;
float fPear=.0;
float fPlum=.0;
float fPeach=.0;
printf("\nGreeting's\n\nToday is July 14, 2008, my name is Craig Hull and this program is for POS/370\n");
printf("\n\nEnterApple: ");
scanf("%f", &fApple);
printf("\n\nEnterOrange: ");
scanf("%f", &fOrange);
printf("\n\nEnterPear: ");
scanf("%f", &fPear);
printf("\n\nEnterPlum: ");
scanf("%f", &fPlum);
printf("\n\nEnterPeach: ");
scanf("%f", &fPeach);
//Now the program is intended to show the item sold by weight of the floating numbers entered
printf("\n\nThe average price of your beverages is $%.2f\n", (fApple+fOrange+fPear+fPlum+fPeach)/5);
//The next section will display the largest price entered for the three beverages using the if/elsestatements
if(fApple>fOrange||fApple>fPear)
{
printf("%.2fApple");
}
else if(fOrange>fPear||fOrange>fApple)
{
printf("%.2fOrange");
}
else if(fPear>fOrange ||fPear>fApple)
{
printf("%.2fPear");
}
//End if else statements
printf("\n\nThank you created by Craig Hull.");
getch();
}

Re: Simple example of cash register program

Posted 14 July 2008 - 05:08 AM

One more question I need help on calculating how much a single customer could buy for a set amount of money (i.e. $20), compute and output th max weight (lbs) of each product the customer could buy for that amount usig 1 decimal place.

Any help is Greatly appreciated
Thanks a million

OliveOyl3471, on 14 Jul, 2008 - 03:19 AM, said:

This program will work, if all you want to do is what you stated in your first post. It's not going to find the highest or lowest, or the average though.