6 Replies - 8425 Views - Last Post: 14 July 2008 - 05:08 AM Rate Topic: -----

#1 Pcguru7  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 11-July 08

Simple example of cash register program

Post icon  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:”)

Is This A Good Question/Topic? 0
  • +

Replies To: Simple example of cash register program

#2 captainhampton  Icon User is offline

  • Jawsome++;
  • member icon

Reputation: 13
  • View blog
  • Posts: 548
  • Joined: 17-October 07

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;
}



Was This Post Helpful? 0
  • +
  • -

#3 Pcguru7  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 11-July 08

Re: Simple example of cash register program

Posted 11 July 2008 - 11:22 AM

View Postcaptainhampton, on 11 Jul, 2008 - 06:32 AM, said:

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;
}



Was This Post Helpful? 0
  • +
  • -

#4 gabehabe  Icon User is offline

  • GabehabeSwamp
  • member icon




Reputation: 1382
  • View blog
  • Posts: 10,962
  • Joined: 06-February 08

Re: Simple example of cash register program

Posted 11 July 2008 - 11:29 AM

Why did you just quote him and nothing else?

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#5 Pcguru7  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 11-July 08

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();

}

Mod edit: Please :code:
Thanks, gabehabe :)
Was This Post Helpful? 0
  • +
  • -

#6 OliveOyl3471  Icon User is offline

  • Everybody's crazy but me!
  • member icon

Reputation: 134
  • View blog
  • Posts: 6,581
  • Joined: 11-July 07

Re: Simple example of cash register program

Posted 14 July 2008 - 03:19 AM

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.

#include<iostream>

using namespace std;

int main()
{
    cout<<"Welcome to Meijer.\n";
    //get prices
    string products[5] = {"Corn", "Peas", "Potatoes", "Apples","Peaches"};
    double prices[5];
    for(int x=0; x<=4; x++)
    {

        cout<<"Please enter price per pound of "<<products[x]<<endl; 
        cin>>prices[x];   
          }
    cout<<"\n\nThese are the products available today: \n";
for (int z =0; z<=4; z++)
{
    cout<<products[z]<<": "<<prices[z]<<endl;
    }
    
    system("Pause");
    return 0;
    }


edit--forgot the code tags

This post has been edited by OliveOyl3471: 14 July 2008 - 03:29 AM

Was This Post Helpful? 0
  • +
  • -

#7 Pcguru7  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 11-July 08

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



View PostOliveOyl3471, 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.

#include<iostream>

using namespace std;

int main()
{
    cout<<"Welcome to Meijer.\n";
    //get prices
    string products[5] = {"Corn", "Peas", "Potatoes", "Apples","Peaches"};
    double prices[5];
    for(int x=0; x<=4; x++)
    {

        cout<<"Please enter price per pound of "<<products[x]<<endl; 
        cin>>prices[x];   
          }
    cout<<"\n\nThese are the products available today: \n";
for (int z =0; z<=4; z++)
{
    cout<<products[z]<<": "<<prices[z]<<endl;
    }
    
    system("Pause");
    return 0;
    }


edit--forgot the code tags

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1