Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need it in java please if you can do these 2 it will be great thank you 10 Points Question 14 Write a Java

i need it in java please image text in transcribed
if you can do these 2 it will be great thank you image text in transcribed
image text in transcribed
10 Points Question 14 Write a Java application to do the following: a. Asks the user to enter a runner's first name, distance traveled and time elapsed. Create an object called runner1 from class Marathon Runner you defined in previous question and set its values according to the input data. b. Display the details of runnerl. c. Display the message "You broke the speed record" if runnerl is faster than the speed record of value 6.7 (m/s). 20 Points Question 13 Define a class with the following specifications: c. a Create a class called Marathon Runner that has three private data members: name (String), distance (double) and time (double). b. Write a constructor that accepts name, distance, and time as input parameters to initialize the private data members. Provide only one accessor (get) method and one mutator (set) method for the distance data member. d. Define a private method called calculateSpeed() which calculates and returns the speed (double) of the distance marathon runner. The speed is calculated using the formula: speed = time e. Define a public method called isFaster() that accepts as input parameter a speed record(double). The method should return true if the current runner's speed is faster than the speed record, otherwise, return false. L Define a public method called display Details to display on the screen the runner's details as in the following sample: Runner name: Ahmed Distance traveled: 11700 m Time elapsed: 2372.0 s Runner's Speed: 493 m/s Question 12 16 Points Write a Java program that displays a shape representing capital letter of N as shown in the examples below. The program should ask the user to enter an integer number size greater than or equal to 4 representing the size of the letter N in terms of number of rows and columns. Appropriate error message should be displayed if the user input for size is invalid. Examples Enter size >=4 : 4 Enter size >=4 : 6 Enter size >=4 : 7 * * * ** * ***

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

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions