Question: CHALLENGE ACTIVITY 1 . 5 . 2 : Floating - point numbers ( double ) . 5 2 5 5 6 6 . 3 8

CHALLENGE
ACTIVITY
1.5.2: Floating-point numbers (double).
525566.3824902q3zqy7
One week equals 7 days. The following program intends to read a floating-point value from input, convert the value from days to weeks, and output the quantity in weeks, but the code contains three errors. Find and fix all three errors.
Ex: If the input is 2.5, then the output is:
0.357 weeks
import java.util.Scanner;
public class DaysToweeks {
public static void main(String[] args){
Scanner scnr = new Scanner(System. in);
I/ Modify the following code
int lengthDays;
int lengthWeeks;
lengthDays =scnr*nextInt();
lengthweeks = lengthDays ?7;
system.out.printf("%.3f weeks ??
, lengthweeks);
}
}
 CHALLENGE ACTIVITY 1.5.2: Floating-point numbers (double). 525566.3824902q3zqy7 One week equals 7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!