Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with second assignment code Problem #2 (5 points) Calculate the value for x. X = a + b* c/d-e a, b, c, d,

image text in transcribedimage text in transcribedimage text in transcribedNeed help with second assignment code

Problem #2 (5 points) Calculate the value for x. X = a + b* c/d-e a, b, c, d, e are the variables and the datatype is int. Please get those values from the keyboard input. Calculate the x and print out the value. Java.java 2 3 E // Assignment 1 public class Java { public static void main (String [] args) { System.out.println ("This Application Displays A rectangle, An Oval, An Arrow" " And A Diamond Using Asterisks (*)"); 4 5 6 7 *** 8 * 9 * * ***** * 10 * * * * 11 System.out.print ("********* System.out.print ("* System.out.print ("* System.out.print ("* System.out.print ("* System.out.print ("* System.out.print ("* System.out.print ("* System.out.print ("********* * * "); * * "); * "); * "); * "); * "); * "); * * "); * "); 12 * 13 * * 14 } 15 16 17 18 } 19 20 21 22 // Assignment 2 Fpublic static void main(String[] args) { Scanner sc = new Scanner(System.in); int x, a, b, c, d, e; //variables declaration I Project 09 > Project Java.java Chaptero C:\Users\lando IdeaProjects\Chapter 18 idea 19 // Assignment 2 1o.gitignore 20 public static void main(String[] args) { misc.xml 21 Scanner sc = new Scanner(System.in); modules.xml 22 int x, a, b, c, d, e; //variables declaration| workspace.xml 23 //input values out 24 System.out.print("Enter the value of a:"); src 25 a = sc.nextInt(); Java 26 System.out.print("Enter the value of b:"); 1. Chaptero.im 27 b = sc.nextInt(); > Milli External Libraries 28 System.out.print("Enter the value of c:"); Scratches and Consoles 29 C = sc.nextInt(); 30 System.out.print("Enter the value of d:"); 31 d = sc.nextInt(); 32 System.out.print("Enter the value of e:"); 33 e = sc.nextInt(); 34 35 x = a + b * c/ d - e; //calculate x 36 //print result (x value) 37 System.out.println(" The value of X is: "+x); 38 39 } Build: Build Output Event Log class, interface, or enum expected C:\Users\lando\IdeaProjects\Chaptero\src\Java.java:20:15 5 E 3:23 PM Build completed with 10 errors and 0 warnings in 894 ms class, interface, or enum expected java: class, interface, or enum expected i class, interface, or enum expected 3:24 PM Build completed successfully in 1 sec, 69 ms O class, interface, or enum expected O class, interface, or enum expected 3:24 PM Build completed successfully in 1 sec, 146 ms e class, interface, or enum expected O class, interface, or enum expected 3:30 PM Build completed successfully in 1 sec, 10 ms e class, interface, or enum expected e class, interface, or enum expected 3:32 PM Build completed with 15 errors and a warnings in 820 ms O class, interface, or enum expected I. Structure O Favorites IntelliJ IDEA 2020.3.2 available Update

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

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

LO5.2 Discuss government failure and explain why it happens.

Answered: 1 week ago