Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

Is there anyway to fix this?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions