I am needing to make a program add and multiple from two different entries and display the total on a different line. I am needing the syntax on how to add and multiply. A web reference page would be good as well. All I have is two classes at this time, main and subclass. As you can see from my question I am new. Your assistance is appreciated.
BobBrown
0
Newbie Poster
Recommended Answers
Jump to PostClassA:
public static double add(double a, double b) { return a+b; }
Main
import java.util.Scanner; .................. Scanner scan = new Scanner(System.in); // print message for user to enter input String strA = scan.nextLine(); double a = Double.parseDouble(strA); // print message for user to enter …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.