Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. help me to make a small program

help me to make a small program

Scheduled Pinned Locked Moved JavaScript
performancehelptutorial
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello Everyone, I would be very happy if u guys help me to make a small program based on the following details. I just need u to help me only the part specially how to write the first condition. cheers :) If a car driver speeds no more than 20 km/h over the speed limit, the driver will avoid the income-based unit fines , and gets just the infraction fine . Make a program that tells how much the infraction fine is. It’s based on the speed limit and the excess speed. The program asks for the driving speed and the speed limit. If there is speeding the ticket will be decided upon based on the following rules: If the speed limit is 10-60 kilometers an hour, and the excess speed is no more than 15 km/h, the speeding leads into a 85-euro infraction fine . More than 15 but no more than 20 km/h leads into an infraction fine of 115 euros. If the speed limit is 70-120 kilometers an hour, a max 15 km/h speeding will be penalizes with 70-euro infraction fine. The infraction fine is 100 euros when the excess speed is more than 15 km/h, but no more than 20 km/h. (If the driver drives more than 20 km/h over the limit => he will get unit fines,.

    L P Z 3 Replies Last reply
    0
    • L Lost User

      Hello Everyone, I would be very happy if u guys help me to make a small program based on the following details. I just need u to help me only the part specially how to write the first condition. cheers :) If a car driver speeds no more than 20 km/h over the speed limit, the driver will avoid the income-based unit fines , and gets just the infraction fine . Make a program that tells how much the infraction fine is. It’s based on the speed limit and the excess speed. The program asks for the driving speed and the speed limit. If there is speeding the ticket will be decided upon based on the following rules: If the speed limit is 10-60 kilometers an hour, and the excess speed is no more than 15 km/h, the speeding leads into a 85-euro infraction fine . More than 15 but no more than 20 km/h leads into an infraction fine of 115 euros. If the speed limit is 70-120 kilometers an hour, a max 15 km/h speeding will be penalizes with 70-euro infraction fine. The infraction fine is 100 euros when the excess speed is more than 15 km/h, but no more than 20 km/h. (If the driver drives more than 20 km/h over the limit => he will get unit fines,.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      1. This is not a Javascript question. 2. Sorry, but we do not do other people's homework.

      L 1 Reply Last reply
      0
      • L Lost User

        Hello Everyone, I would be very happy if u guys help me to make a small program based on the following details. I just need u to help me only the part specially how to write the first condition. cheers :) If a car driver speeds no more than 20 km/h over the speed limit, the driver will avoid the income-based unit fines , and gets just the infraction fine . Make a program that tells how much the infraction fine is. It’s based on the speed limit and the excess speed. The program asks for the driving speed and the speed limit. If there is speeding the ticket will be decided upon based on the following rules: If the speed limit is 10-60 kilometers an hour, and the excess speed is no more than 15 km/h, the speeding leads into a 85-euro infraction fine . More than 15 but no more than 20 km/h leads into an infraction fine of 115 euros. If the speed limit is 70-120 kilometers an hour, a max 15 km/h speeding will be penalizes with 70-euro infraction fine. The infraction fine is 100 euros when the excess speed is more than 15 km/h, but no more than 20 km/h. (If the driver drives more than 20 km/h over the limit => he will get unit fines,.

        P Offline
        P Offline
        Peter Leow
        wrote on last edited by
        #3

        Refer to your JS lesson notes, especially those concern JS operators and conditions, and you should be able to complete your homework. If for whatever reason, you do not have those notes, fret not. Check out some online tutorials, such as JavaScript Operators[^] and JavaScript If...Else Statements[^]

        Peter Leow https://www.amazon.com/author/peterleow

        L 1 Reply Last reply
        0
        • L Lost User

          1. This is not a Javascript question. 2. Sorry, but we do not do other people's homework.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I am really sorry. I have been trying to solve this for long but still can't. I know the conditions and operators but i could not come up with the right one. you mention its not javascript question? why its not a javascript question? thanks

          L 1 Reply Last reply
          0
          • P Peter Leow

            Refer to your JS lesson notes, especially those concern JS operators and conditions, and you should be able to complete your homework. If for whatever reason, you do not have those notes, fret not. Check out some online tutorials, such as JavaScript Operators[^] and JavaScript If...Else Statements[^]

            Peter Leow https://www.amazon.com/author/peterleow

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            I know those operators and condition but i can not use them in the right way :) would be happy if just give me a hints to write the first condition .. thanks

            1 Reply Last reply
            0
            • L Lost User

              I am really sorry. I have been trying to solve this for long but still can't. I know the conditions and operators but i could not come up with the right one. you mention its not javascript question? why its not a javascript question? thanks

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Start by writing the rules in natural language (from your question), something like:

              Display a message
              Read Speed value
              If speed is greater than [ speed value 1 ]
              Then
              check values and issue fine
              ElseIf speed is greater than [ speed value 2 ]
              Then
              check values and issue fine
              ...
              Endif

              Once you have that logic written down you can convert it to your programming language.

              1 Reply Last reply
              0
              • L Lost User

                Hello Everyone, I would be very happy if u guys help me to make a small program based on the following details. I just need u to help me only the part specially how to write the first condition. cheers :) If a car driver speeds no more than 20 km/h over the speed limit, the driver will avoid the income-based unit fines , and gets just the infraction fine . Make a program that tells how much the infraction fine is. It’s based on the speed limit and the excess speed. The program asks for the driving speed and the speed limit. If there is speeding the ticket will be decided upon based on the following rules: If the speed limit is 10-60 kilometers an hour, and the excess speed is no more than 15 km/h, the speeding leads into a 85-euro infraction fine . More than 15 but no more than 20 km/h leads into an infraction fine of 115 euros. If the speed limit is 70-120 kilometers an hour, a max 15 km/h speeding will be penalizes with 70-euro infraction fine. The infraction fine is 100 euros when the excess speed is more than 15 km/h, but no more than 20 km/h. (If the driver drives more than 20 km/h over the limit => he will get unit fines,.

                Z Offline
                Z Offline
                ZurdoDev
                wrote on last edited by
                #7

                Where are you stuck?

                There are only 10 types of people in the world, those who understand binary and those who don't.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups