Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.anoldwebsite;
- public class CodeTesterApp {
- public static void main(String args[]) {
- // display a welcome message
- System.out.println("Welcome to the Code Tester");
- System.out.println();
- // hard code three values
- String productCode = "java";
- double price = 49.50;
- int quantity = 2;
- // perform a calculation
- double total = price * quantity;
- // display the output
- String message =
- "Code: " + productCode + "\n" +
- "Price: " + price + "\n" +
- "Quantity: " + quantity + "\n" +
- "Total: " + total + "\n";
- System.out.println(message);
- // display a goodbye message
- System.out.println("Bye!");
- }
- }
- //Now do the exercise on the link below. Copy the link and paste it in a browser and then log in.
- https://repl.it/student_embed/assignment/3760944/009090c415ba8596291817f427f86e73
Advertisement
Add Comment
Please, Sign In to add comment