Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8867859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:08:23+00:00 2026-06-14T17:08:23+00:00

I’m quite a newbie at c# and need some help with some loop statements.

  • 0

I’m quite a newbie at c# and need some help with some loop statements.

I’m practising by designing a program that calculates cost per mile (which is 50p) and adds £30.00 every 1000 as a wear $ tear charge.

I’m having problems getting my head around the logic, if anyone could give me a few tips that would be great.

namespace ConsoleApplication10
{
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Input start milleage:");
            decimal StartMile = Convert.ToDecimal(Console.ReadLine());
        Console.WriteLine("Input Finish milleage:");
            decimal FinishMile = Convert.ToDecimal(Console.ReadLine());
            decimal TotalMilleage = FinishMile - StartMile;

            if (TotalMilleage < 1000)

                TotalMilleage = TotalMilleage / 2;

                Console.WriteLine("Total charge for hire:{0:C}", TotalMilleage);


            Theres the code Ive done so far :S
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:08:24+00:00Added an answer on June 14, 2026 at 5:08 pm

    You do not need loop just make expression like this, Assuming £30 only charged after 1000 miles.

    double price = 0.5 * DistanceInMile + ((int)(DistanceInMile /1000)) *30;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm quite newbie with c++, and I'm having some trouble figuring out what is
I think that this is a newbie type question but I have quite understood
this might be quite a newbie question, but i need to process a certain
I need to do several two-step or three-step commands in Git quite frequently, that
quite a newbie here but here's a small test code that explains my issue.
I am quite a newbie with OSGi and struggeling with including bundles into my
I am quite a newbie in OOP using java and I'm learning as I
Firstly, I'm quite a newbie in rails/heroku, so forgive the newbiness in advance! I
I'm aware it's a quite simple question but I'm a newbie to C#, ASP.NET
HERE IS THE CODE: http://min.us/mWdMO0n14 I'm a Obj C newbie, so I've searched quite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.