Java assignment

User Generated

Tenpr032

Computer Science

Description

I need help answering the attached asssignment

Unformatted Attachment Preview

Introduction To Computing JAVA Assignment 1 Go to http://www.browxy.com/ Click on register at the top right corner. Register and verify your email Sign In to the website. 2 Creating a Java File Click on Save. A popup will appear, type “HelloWorld” inside it(Without the quotations). It may show an error. Do not worry about it now. Once Java file is created, You can begin typing your code! 3 Writing your First Java Program  Type the below code into your Java file The class name and the file name must be same. 4 Executing the Program  After the program is written, click on Save at the top. A window will pop up with success compilation message. Click on Start on top and you will see the execution on the console view at the bottom. 5 Checking the Output  After the program is executed, output can be seen in the Console box as shown below 6 Accepting Inputs from User  The below program illustrates, how to accept input from the console.  Click on New On new file open click on Save and name the file userInput The execution takes some time. Wait after you type the number for the output to occur Program 1 7 Declaring Variables Variables are used in Java program to store values which can be of any type (Integer, Double, String, etc., )  Before variables can be used in any Java Program, they need to be declared  Line 9 in Program 1 declares a variable “a”of the type “Integer” and provides it with an initial value of 0.  In other words, we Initialized the value of a to 0.  8 Arithmetic Operators Operators are used in Java, to build an expression. (Ex: int z = x + y)  Java provides the following Arithmetic Operators :  9 Methods  A java method is a collection of statements, grouped together to perform an operation 10 Program to Add 2 numbers using Functions Program 2 11 Activity 1. Write a Java program to perform simple arithmetic operations (add, subtract, multiply and divide) on 2 numbers and display the output on console ( use Java methods in your program) a) Use double / float datatype to store numbers b) Range of numbers : 1 to 100 (Do not use 0) The output should look something like this When the two numbers are 8,4 12 Submission • Click on Get URL and copy the url and paste it in submission. • Check the URLs by opening it in a window before submission. • Also, to get the correct URL make sure you have opened the correct file in the background. If you need to go back and look at a file, select the name of the file using the dropdown list provided at the left and click Open. 13
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hello, You are now good to go. Here is the code. Just create the account as directed on the document then copy paste this code. I cannot create an account for you because you will need it over again and again and on a different note we may be in different locations.import java.util.Scanner;/** * Created on 20/10/2017. */public class Main { public sta...


Anonymous
Goes above and beyond expectations!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags