Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

may you please help me code this in java please. Please make sure all the input and outputs are correct. thank you #1 Write a

may you please help me code this in java please. Please make sure all the input and outputs are correct. thank you

image text in transcribed

\#1 Write a section of code that is given two integers representing a speed limit and driving speed in miles per hour (mph) and outputs the traffic ticket amount. Driving 10mph under the speed limit (or slower) receives a $50 ticket. Driving 6 - 20 mph over the speed limit receives a $75 ticket. Driving 21 - 40 mph over the speed limit receives a $150 ticket. Driving faster than 40mph over the speed limit receives a $300 ticket. Otherwise, no ticket is received. Ex If the input is: 3545 the output is: $75 fine Ex. If the input is: 3530 the output is: no fine \#2 Given a line of text as input, output the number of characters excluding spaces, periods, exclamation points, or commas. Ex. If the input is: Please, do not count the punctuation or spaces!!! the output is: Note: Account for all characters that are not spaces, periods, exclamation points, or commas. \#3 Write a section of code that reads a sequence of integers until a negative number is entered. The program should count how many numbers are equal to the first number entered and also provide the overall sum of all the numbers. (Do not include the first integer entered in the sum.) Ex. If the input is: 31231231 the output is: Found 23s. Overall Total: 12

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions