Click here to Skip to main content
15,900,725 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello
I took C# as a required course. My instructor gave us following project but honestly I do not have any idea where I can start or what should I do ( I just have permit to use if function , switch , method and no advance technique). Is that possible somebody give me a tip about what should I do with this project and where I should start?
Thanks
Project:
For this program, you will present the user with two choice boxes (either a combo box or a list box) of supplies and of pets available for purchase along with their corresponding prices. As each item or pet is selected you should make visible a textbox that asks how many they would like and then confirm the purchase with a yes/no pop-up window. Keep track of the number of pets purchased and the number of supply items purchased and also the total amount of the sale. Have a Done button (in addition to the quit button of #1) that the user should press when finished making purchases. When the Done button is pressed display a receipt that lists the total number of supplies purchased and the total number of pets purchased and the cost for each along with the total cost of the sale. Make SURE you error check the quantity purchased.
Posted
Updated 15-Sep-10 10:55am
v2
Comments
Sandeep Mewara 15-Sep-10 14:57pm    
Use 'Add Comment' feature to respond back to any answer.
Use 'Improve Question' link to edit/update the quetion.

shiftwanted wrote:
Is that possible


Yes, it's possible. You can do pretty much anything with just if statements.

I don't see how this is that difficult personally, but I've been doing this longer.

Set up individual counters for each type of animal or supply you are programming in.

Then, when the user makes a selection from either combobox, show the textbox and clear it.

It doesn't say to put in a "buy" button, but I assume you would do that unless you're only allowing the quantity to be less than 10. But, either way when they've selected the quantity, ask them if they want to proceed with a "Yes/No" dialog.

When they hit yes, increment the counter for that supply or animal.

When they hit done, print out the totals.

How have you worked for 10 days on this?
 
Share this answer
 
Comments
Sandeep Mewara 15-Sep-10 14:55pm    
Comment from OP:
Dear William Winner

Thanks. You help me a lot.

I spend 10 days and more than 30 hours on this project because I did not wrote a single line of code in my life. I hear I should know about too many things before I start writing program. I try to understand visual C# but seems like the book just wrote for people wrote any knid of program before.

For example when you wrote "Set up individual counters " I should go through Internet and book to understand what do you mean by that and how I can do that.But, I am glad I asked my question here because of your answer and Chirantan I found too many good source that can help me through this program.

Thanks again
William Winner 15-Sep-10 15:05pm    
If you don't know how to set up individual counters, then you're going to have a very hard time in this class.

All I mean by that is:

int Cats = 0;
int Dogs = 0;
int CatFood = 0;
int DogFood = 0;
etc...

A counter is something you use to keep track of the count of something. It can be a float, int, double, long, etc...
shiftwanted 15-Sep-10 16:05pm    
Yes. Look like I have hard time in this class. I am glad I found this froum. Because this froum give my hope back. Do you have any other suggestion? Any link to any article can help me.
Thanks again
shiftwanted 20-Sep-10 9:27am    
Reason for my vote of 5
Automatic vote of 5 for accepting answer.
Quote: " I do not have any idea where I can start or what should I do".

So what have you been doing in all your lectures, homework, class exercises etc? There is an abundance of resources, samples, training aids on the internet to help you, so try and do some research for yourself to get started. You could do a lot worse than start by looking at some of the articles here on CodeProject.
 
Share this answer
 
Comments
CPallini 15-Sep-10 9:37am    
Quote reprise: "just have permit to use if function".
'if function'? OMG!
Dalek Dave 15-Sep-10 10:03am    
What do you mean 'Permit to use if function'

I never obtained a permit. Who do you have to apply to in order to get one?
Sandeep Mewara 15-Sep-10 14:54pm    
Comment from OP:
Hi Richard MacCutchan

I can see your point. I worked on this project for last 10 days but I just stuck. I did combobox , different logic of if.. else. But simply non of them work. I look for article but I could not find any. That a reason I asked my question here. If you know any article can help me for this project I am more than happy to read them.

Thanks again
shiftwanted 15-Sep-10 16:00pm    
Dear Mewara. Thanks and sorry for did no use the comment.
shiftwanted 15-Sep-10 16:01pm    
Dear Delek and Richard
Thank you. Because we just studay through if... else and switch.. break I do not have permit to use other function. Thanks
This is a kind of shopping cart. as this is your assignment you must do it, but you need help to start so i am giving you some out lines.
you will be suing Grid view. This will have buttons for add more and this will add new row in grid. in grid view you can add controls (text box, drop down, etc.)

once done and going to another page, you can store grid view data in a table and store to some session or cache and display receipt on another page.

Try your self :) as much effort you will do, you will learn newer things.

Hope you can start now.

Thanks,
Chirantan
 
Share this answer
 
Comments
William Winner 15-Sep-10 13:56pm    
I don't see anywhere in the description that says a running tab needs to be displayed of purchased items.
Sandeep Mewara 15-Sep-10 14:55pm    
Comment from OP:
Dear Chirantan Upadhyay

WOW. Thanks a lot. I did not know that such a thing like Grid view exist. I found some article about how this work and hopfully I would be able to use it. Thanks this help me a lot.
shiftwanted 15-Sep-10 16:03pm    
Dear William
I think I just should use to buttom Done and Quiet. The done buttom will show the resualt of selction and Quiet will close program. Thanks again for your tip. I should ask about Grid View.
Thanks again
I want to say thank you all. With your help I solved my problem.
Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900