This program show how to calculate Car Rental using type of car, Km and Number of rental days. Insert that details and click Process Button then calculate total rental and Click Clear Button Clear all details for new One. When you click Exit button exit this program.
C#.net Code for Simple Car Rental Program
Download Source Project
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace CarRental { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void processButton_Click(object sender, EventArgs e) { decimal day, total,km; day = decimal.Parse(daytextBox.Text); km = decimal.Parse(kmtextBox.Text); total = 0; if (HondarButton.Checked) { total = (1500 + (20 * km)) - (80 * day); } else if (nissanrButton.Checked) { total = (2000 + (30 * km)) - (60 * day); } else if(civicrButton.Checked) { total = (2500 + (40 * km)) - (50 * day); } else { MessageBox.Show("Invalid Info"); } totaltextBox.Text = total.ToString("c"); } } private void clear() { daytextBox.Clear(); kmtextBox.Clear(); totaltextBox.Clear(); HondarButton.Checked = true; daytextBox.Focus(); } private void exitButton_Click(object sender, EventArgs e) { this.Close(); } private void clearButton_Click(object sender, EventArgs e) { clear(); } } }
Thank you puja
ReplyDeleteIntriguing post. I Have Been pondering about this issue, so a debt of gratitude is in order for posting. Entirely cool post.It 's extremely exceptionally decent and Useful post.Thanks Elia And Ponto
ReplyDeleteI love this blog!! The flash up the top is awesome!! Newmarket Wedding Limo
ReplyDeleteThis is a truly good site post. Not too many people would actually, the way you just did. I am really impressed that there is so much information about this subject that have been uncovered and you’ve done your best, with so much class. If wanted to know more about green smoke reviews, than by all means come in and check our stuff. auto car rental
ReplyDeleteThank you for sharing valuable information
ReplyDeletebook taxi online for outstation
one way drop taxi contact number
Backseatcabs|Car rental in Darbhanga
ReplyDeleteNo:536Deuri Rd, Raham Khan, Donar, Darbhanga, Bihar 846004
07061806038
https://www.carrentalindarbhanga.in/
https://g.page/carrentalindarbhanga?share
car rental in darbhanga