Question
I am trying to work out this program in which you are supposed to Calculate and print out the multiplication and Use three methods: userInput(),
I am trying to work out this program in which you are supposed to Calculate and print out the multiplication and Use three methods: userInput(), calculation(), printout().
package com.practice3; import java.util.Scanner;
public class Main {
static void userInput(){
double num1; double num2;
Scanner input = new Scanner(System.in); System.out.print("Enter your first number"); num1 = input.nextDouble(); System.out.print("Enter your secound number"); num2 = input.nextDouble(); } static void calculation(double num1, double num2 , double result){
userInput(); result = num1 * num2;
} static void printout(double num1, double num2 , double result){ calculation();
System.out.print(num1+ " x " + num2 +" = " + result );
}
static void main(String[] args) {
calculation(); printout(); } }
When running the program it gives me these location errors
Is there anyway to fix this?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started