+ 3
Pls I need help with code coach : Trip planner
7 Antworten
+ 2
this is node.js
function main() {
var distance = parseInt(readLine());
x = (distance/40)*60
console.log(x);
}
+ 2
Oh really i didnt know🤦♀️
+ 1
and this is java
import java.util.*;
public class TripPlanner {
public static void main(String[] args){
Part1();
Part2();
Part3();
Part4();
}
public static void Part1(){
Scanner input=new Scanner(System.in);
System.out.println("Welcome!");
System.out.println("What is your name?");
String name=input.next();
//input name.
System.out.println("Nice to meet you "+name+", Where are you Travelling?");
String place=input.next();
System.out.println("Great "+place+" sounds like a great trip!");
}
public static void Part2(){
Scanner input=new Scanner(System.in);
System.out.println("How many days are you going to spend travelling?");
int days=input.nextInt();
System.out.println("How much money, in USD, are you planning to spend on your trip?");
int money=input.nextInt();
System.out.println("What is the currency symbols favourite travel destination?");
String currency=input.next();
System.out.printl
+ 1
Wow! Thanks ☺️
+ 1
function main()
var distance = parseInt(readLine(40 miles), 10);
console.log("3.75*60=255!");