Programming > QUESTIONS & ANSWERS > Ryerson University ITM ITM 200 You may need to refer to table 3.4 in chapter 3.7 to determine whi (All)

Ryerson University ITM ITM 200 You may need to refer to table 3.4 in chapter 3.7 to determine which methods you should use. Alternatively, you may want to look at the API for the... Share Question

Document Content and Description Below

Question I need help in writing java code. Pleasee see attach questions to solve. I need them ASAP For this porTon of the assignment you will be working with the String class and using several di�... �erent methods of the String class to manipulate String variables. You may need to refer to table 3.4 in chapter 3.7 to determine which methods you should use. AlternaTvely, you may want to look at the API for the String class. Note: At the bo²om of the code block is a line of code that is necessary for the unit test to funcTon. Ensure that you do not accidentally remove or modify it. When you are ³nished, you can run the unit tests located in the QuesTon2´est.java ³le to verify the correctness of your soluTon. 1) Declare a String variable with the idenT³er movieName and assign it the value: It's a Mad, Mad, Mad, Mad World 2) Declare a String variable with the idenT³er upperCase and assign it the result of a method call on the movieName object reference that returns a String with all uppercase le²ers. 3) Declare a String variable with the idenT³er lowerCase and assign it the result of a method call on the movieName object reference that returns a String with all lowercase le²ers. 4) Declare a String variable with the idenT³er noCommas and assign it the result of a method call on the movieName object reference that replaces all of the commas in the String with nothing (i.e. removes them) 5) Declare a char variable with the idenT³er ³rstCharacter and assign it the result of a method call on the movieName object reference that returns the char (le²er) at the start of the String 6) Declare an int variable with the idenT³er lengthOfString and assign it the result of a method call on the movieName object reference that returns the length of the String. 7) Declare an int variable with the idenT³er ³rstLowerCaseA and assign it the result of a method call on the movieName object reference that returns the locaTon of the ³rst occurrence of the charliteral 'a’. quesTon3 For this porTon of the assignment you will be working with the Scanner class to read in user input. You will also be using the println method to prompt the user to enter certain values. Note: At the bo²om of the code block is a line of code that is necessary for the unit test to funcTon. Ensure that you do not accidentally remove or modify it. When you are ³nished, you can run the unit tests located in the QuesTon3´est.java ³le to verify the correctness of your soluTon. Note: ´his class also contains a main method that will allow you to test your soluTon manually. 1) Create an instance of the Scanner class and associate it with the System.in data source. You may choose any idenT³er you like for your object reference. Note: You may need to import the Scanner class! 2) Use the println method (System.out.println()) to prompt the user to enter a Student's name. 3) Declare a String variable (with idenTfer oF your choosing) and assign it the value returned by calling the nextLine method on your Scanner object reFerence. 4) Use the println method to prompt the user to enter an ID For the student. 5) Declare a variable oF type int and assign it the value returned by calling the nextInt method on the Scanner object reFerence. 6) Use the println method to prompt the user to enter 3 exam scores separated by a space. 7) Declare three int variables and assign each the value returned by calling the nextInt method on the Scanner object reFerence. 8) Declare a variable oF type Student with the idenTfer myStudent and assign it the value oF a Student object using the values in the variables read in in parts 3, 5, and 7 as arguments. QuesTon4 : ±or this porTon oF the assignment you will be working with the Decimal±ormat class to Format numeric values so that they are more presentable. You will also be using the Student class to as a source oF data to Format. ±or Parts 1 - 7 you will choose your own idenTfers For any variables or object reFerences. Make sure to choose meaningFul idenTfers that represent the data that you're working with. Note: At the bo²om oF the code block is a line oF code that is necessary For the unit test to FuncTon. Ensure that you do not accidentally remove or modiFy it. When you are fnished, you can run the unit tests located in the QuesTon2³est.java fle to veriFy the correctness oF your soluTon. 1) Declare a Student variable (with idenTfer oF your own choosing) and assign it an object created by the deFault constructor oF the Student class. 2) Declare an int variable and assign it the result oF the student you created in the previous step's frst exam score. 3) Declare an int variable and assign it the result oF the student you created in the frst step's second exam score. 4) Declare an int variable and assign it the result oF the student you created in the frst step's third exam score. 5) Declare a variable oF type double and assign it the average oF the student's three exam scores. 6) Declare a DecimalFormat variable that will be used to format a student's ID and assign it a reference to a DecimalFormat object with the following paTern: ±here are 7 required digits, and no decimal place. Note: You may need to import the DecimalFormat class! 7) Declare a DecimalFormat variable that will be used to format a student's grade and assign it a reference to a DecimalFormat object with the following paTern: ±he output will have a decimal point and exactly two places (digits) following the decimal point. ±he output will always have at least one digit (leading zero) before the decimal point. ±he output will not contain leading zeros other than the one's digit 8) Declare a String variable with the iden²³er formaTedOutput and assign a value as follows: Name: $name ID: $formaTedID Average Score: $formaTedScore $name should be the name of the student not the literal "$name"$formaTedID should be the ID of the student formaTed by the DecimalFormat object from Part 6 $formaTedScore should be the average exam score formaTed by the DecimalFormat object from Part 7. Ques²on4: For this por²on of the assignment you will be working with the DecimalFormat class to format numeric values so that they are more presentable. You will also be using the Student class to as a source of data to format. For Parts 1 - 7 you will choose your own iden²³ers for any variables or object references. Make sure to choose meaningful iden²³ers that represent the data that you're working with. Note: At the boTom of the code block is a line of code that is necessary for the unit test to func²on. Ensure that you do not accidentally remove or modify it. When you are ³nished, you can run the unit tests located in the Ques²on2±est.java ³le to verify the correctness of your solu²on. 1) Declare a Student variable (with iden²³er of your own choosing) and assign it an object created by the default constructor of the Student class. 2) Declare an int variable and assign it the result of the student you created in the previous step's ³rst exam score. 3) Declare an int variable and assign it the result of the student you created in the ³rst step's second exam score. 4) Declare an int variable and assign it the result of the student you created in the ³rst step's third exam score. 5) Declare a variable of type double and assign it the average of the student's three exam scores. 6) Declare a DecimalFormat variable that will be used to format a student's ID and assign it a reference to a DecimalFormat object with the following paTern: ±here are 7 required digits, and no decimal place. Note: You may need to import the DecimalFormat class! 7) Declare a DecimalFormat variable that will be used to format a student's grade and assign it a reference to a DecimalFormat object with the following paTern: ±he output will have a decimal point and exactly two places (digits) following the decimal point. ±he output will always have at least one digit (leading zero) before the decimal point. ±he output will not contain leading zeros other than the one's digit. 8) Declare a String variable with the iden²³er formaTedOutput and assign a value as follows:Name: $name ID: $formaTedID Average Score: $formaTedScore $name should be the name of the student not the literal "$name” $formaTedID should be the ID of the student formaTed by the DecimalFormat object from Part 6 $formaTedScore should be the average exam score formaTed by the DecimalFormat object from Part 7 Ques²on5: For this por²on of the assignment you will be working with the Random class and genera²ng random numbers. When you are ³nished, you can run the unit tests located in the Ques²on5±est.java ³le to verify the correctness of your solu²on. Note: ±he unit tests use a Monte Carlo style simula²on to test the correctness of a solu²on. In an unlikely, but very small event it is possible for the test to fail with the correct input. ±his is unlikely with high probability. 1) Instan²ate a new Random object (using the default constructor) and assign it to an object reference of your choosing. Note: You may need to import the Random class! 2) Instan²ate a new Random object (using the alternate constructor that takes a single int as an argument and passing the int literal 1 as that argument)and assign it to an object reference of your choosing. 3) Declare an int variable with the iden²³er num1 and use the object reference you created in Part to generate a random number between 0 and 20 inclusive and assign it to num1. 4) Declare an int variable with the iden²³er num2 and use the object reference you created in Part 1 to generate a random number between 17 and 33 inclusive and assign it to num2. 5) Declare an int variable with the iden²³er num3 and use the object reference you created in Part 1 to generate a random number between -15 and 15 inclusive and assign it to num3. 6) Declare an int variable with the iden²³er num4 and use the object reference you created in Part 2 to generate a random number between 0 and 100 inclusive and assign it to num4. 7) Declare an int variable with the iden²³er num5 and use the object reference you created in Part 2 to generate a random number between 1 and 100000 inclusive and assign it to num5. // Your code here: } [Show More]

Last updated: 1 year ago

Preview 1 out of 2 pages

Reviews( 0 )

$12.00

Add to cart

Instant download

Can't find what you want? Try our AI powered Search

OR

GET ASSIGNMENT HELP
40
0

Document information


Connected school, study & course


About the document


Uploaded On

Mar 11, 2021

Number of pages

2

Written in

Seller


seller-icon
Muchiri

Member since 3 years

208 Documents Sold


Additional information

This document has been written for:

Uploaded

Mar 11, 2021

Downloads

 0

Views

 40

Document Keyword Tags

Recommended For You


$12.00
What is Browsegrades

In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Browsegrades · High quality services·