Question: Jump to level 1 Given that 1 week = 7 days, complete the calculation to convert the integer variable numDays to the double variable numWeeks

Jump to level 1
Given that 1 week =7 days, complete the calculation to convert the integer variable numDays to the double variable numWeeks using implicit conversion.
Ex. If the input is 212, then the output is:
30.0 weeks
import java.util.Scanner;
public class WeeksConverter {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
final int DAYS_PER_WEEK =7;
int numbays;
double numweeks;
numbays =scnr*nextInt();
numbleeks =1? Your code goes here */ DAYS_PER_WEEK;
System.out.print (numweeks);
System.out.println(" weeks");
}
}
 Jump to level 1 Given that 1 week =7 days, complete

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!