473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Simple Car Rental pragram

I just started a C# class and our Professor is not very good at teaching much of anything. We are using the Simply C# book (2003) but are using the VB 2008 program and this weeks lab was to build a basic Car Rental app. that would multiply by $25 for each day they wanted to rent, and charge an additional $50 bucks for insurance and a 25% discount for any rentals over 5 days. The only problem is we have never really been taught how to us multiplication or the like so I am scratching my head. Any help out there would be great I am sorry if this is a super basic problem but by reading the book and what little help we get from him I am desperately lost. I can post what code I have so far if needed. Thanks in advance for any and all help.
Feb 28 '10 #1
10 8859
tlhintoq
3,525 Expert 2GB
The only problem is we have never really been taught how to us multiplication or the like so I am scratching my head.
It works the same as it did in 5th grade.

5 times 4 = 20

int Answer = 5 * 4 ;
Feb 28 '10 #2
Thanks for the reply, I was looking for something more in depth. I am slogging through it and have gotten a little further than when I posted. But any more help would be great.
Feb 28 '10 #3
tlhintoq
3,525 Expert 2GB
The only problem is we have never really been taught how to us multiplication
int Answer = 5 * 4 ;
Thanks for the reply, I was looking for something more in depth.
More in depth about... Multiplication?
http://www.multiplication.com/

How to solve word problems?
http://www.lmgtfy.com/?q=Solving+wor...UTF-8&oe=UTF-8

I think if you can make your question less vague you will get answers that are less vague.
Feb 28 '10 #4
Didn't realize I was being vague, I did state that I was looking on what was needed to have each day cost $25 (increase per number of days entered) then a 25% discount for renting for longer than 5 days. I have the program adding the $50 for insurance but I have no idea on how to get it to do the multiplication of the days or the discount here is the (I know beginning level) code I have gotten so far. Again thanks for any help in advance.

Expand|Select|Wrap|Line Numbers
  1.       private void btnCalculate_Click(object sender, EventArgs e)
  2.       {
  3.          // Clear text displayed in label
  4.          lblTotaled.Text = "";
  5.  
  6.         //declare variables
  7.          int intTotaled = 0;
  8.  
  9.          //enter data
  10.          if (txtName.Text == "")
  11.          {
  12.             //error condition
  13.             MessageBox.Show("Please  enter your name and number of days desired",
  14.                                           "Missing Information", MessageBoxButtons.OK,
  15.                                           MessageBoxIcon.Warning);
  16.             txtName.Focus();
  17.          }
  18.          else
  19.          {
  20.             //perform calculations
  21.             if (chkInsurance.Checked == true)
  22.             {
  23.                intTotaled += 50;
  24.             }        
  25.         }
  26.  
  27.         //display results
  28.         lblTotaled.Text = String.Format("{0:C}", intTotaled);
  29.        }
  30.    }
  31. }
Feb 28 '10 #5
Sorry, I'll make sure I remember when I post code the next time.
Feb 28 '10 #6
tlhintoq
3,525 Expert 2GB
Ohhh... You want someone to tell you how to translate the word problem into code. Well that's the very nature of the homework, isn't it?

It's not a question about how to do multiplication in C#.
It's asking for someone to figure out the logic for you.
We can't do that. Let's be honest, if you can't convert an 8th grade word problem into a math formula or simple 3 step process... How do you plan to handle this as a career when a client asks you to build an entire system for handling a hospital, or factory?

The best advice we can give you is "Talk to your instructor".
I just started a C# class and our Professor is not very good at teaching much of anything.
Then go to the dean and ask to be transfered to a different instructor's class or drop the class. I will point out that when you leave the insulated walls of acadamia that you can't just transfer to a different boss. You either learn to communicate with the people that hand out the assigned jobs or you go looking for a new employer.


Bytes has a policy regarding assisting students with their homework.

The short version is that the volunteers here can't help you with schoolwork.
A) We don't know what material you have and have not learned in class.
B) We don't know the guidelines you must follow.
C) In the long run giving you the answers actually short changes your education.

Hint 1: Try hitting Google with terms of your programming language and primary terms of what you want to do. For example "C# custom events" or "VB datagrid Excel". I've found this to be a very effective tool.
Hint 2: Your text book
Hint 3: Your instructor
Hint 4: Posting guidelines regarding homework assignments.






TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Feb 28 '10 #7
I have tried my instructor and have gotten nowhere, I wasn't looking for anyone to write it for me just a little help pointing me in the right direction. I realize its very basic for experts, and I am hoping to one day be able to write above the obvious 3rd grade level I am at. I spent a long time on Google yesterday and that is how I found this site. I was thrilled to see that there were people out there who could help. I am in an evening class that meets once a week, our first week of class our homework was to read the first 5 chapters of the book, since then we have had 3 classes (one canceled due to snow) so and this week we are doing chapter 9 in the book. Maybe not breakneck speed for some people but a little fast for most of us in the class (16 students 9 lost people) the rest have had previous experience.

Now that I have Hint #1 I will go back to Google and enter the items you suggested. Thanks for all your assistance.
Feb 28 '10 #8
sashi
1,754 Expert 1GB
I just started a C# class and our Professor is not very good at teaching much of anything.
What a testimonial? Wonderful isn't it? You prof should be proud for having a great student like you :)
Mar 1 '10 #9
there are lot of web site for visiting about cars but for improving and extending my cars business mostly i visited to this "web site" but now i need further more web site if do you have reply me for my business promotion.
Jul 3 '10 #10
int numDays = paramNumDays;
int rentalCost = 25 * numDays;
bool isInsured = paramIsInsured;

if(numDays > 4)
{
rentalCost = numDays - (numDays * 25%)
}

if(isInsured)
{
rentalCost += 50;
}

//rentalCost is your output, dude!!!
May 22 '12 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: RSW | last post by:
Does any one have an MS ACCESS database for rental properties Any help would be appreciated. RSW
3
by: Denis | last post by:
RE: http://www.rental-planner.com/mainscreen.jpg Hello everyone, I am trying to build a car rental bookings software but I am not sure how to implement the drag'n'drop functionality. ..you...
3
by: DP | last post by:
hi, does any1 know where i could find a video rental database? thanx dev
0
by: Madgame | last post by:
urgent... i my computer got virus and all my files are gone... anyone got any software about rental system? rental of books or what? help... need to submit it.... can send me the source code or the...
5
by: mich dobelman | last post by:
I am developing a web crawler which collects info from more than 50,0000 pages. but i am afraid this is going to clog the rental web server if I run it every single day. Is it possible to stop...
3
by: Jason Mobarak | last post by:
Hello -- I'm attempting to get a handle on how to do xpath queries with System.Xml -- so far the biggest hurdle has been how to deal with a default namespace. If I use the test xml: <?xml...
1
by: jj Vorster | last post by:
Hi I am in need of a Gantt Chart in Access that I can use in the development of a rental Company. I should be able to see: Vehicle booking Vehicle out ( Different colour than booking) Vehicle...
2
by: trinismooth | last post by:
HI good day... I am using ms access 2003 to create a vehicle rental database and I am having a little problem getting the calculations for late vehicles...The problem is that late vehicles are...
10
by: Nkhosinathie | last post by:
i've be given this task to do. as a member i want to learn this program while i'm doing it with you.i'm hoping i'll be with you through the next two hours. this is the program below. Program 2...
0
by: shenlishu520 | last post by:
NuTemp Portable Heater Rental Nationwide Non-residential. NuTemp rents portable heaters for construction, commercial, industrial applications. Electric, propane, natural gas, steam units available...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.