Java 6.4 "Drawing Class"... multiplication | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Java 6.4 "Drawing Class"... multiplication

im not understanding what im doing wrong. I'm stuck on two error codes. ".class" and "not a statement" if anyone has tips that would be great. CodeCoach Practice: Question You need to calculate how many pencils are in the classroom. You're given code which takes as input the number of students and the number of pencils each of them has. Task Calculate and output the total number of pencils. Sample Input 11 3 Sample Output 33 in java: import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner myObj = new Scanner(System.in); int pupils = myObj.nextInt(); int pencils = myObj.nextInt(); //your code goes here } }

21st Jan 2022, 11:27 PM
Dani
Dani - avatar
2 Answers
+ 1
So far, it doesn't look like you've done anything.
22nd Jan 2022, 12:06 AM
Solo
Solo - avatar
0
//your code goes here int total = pupils * pencils; System.out.println(total);
1st Feb 2022, 11:08 PM
Flaviane Oliveira