The Program Spec The following expressions assume that you have stored the sum of the numbers of your student ID into the variable myld, and the number of letters in your last (family) name into the variable nLet. No user input allowed. Rather, declare and assign these variables before computing the following values. First do the math on paper so you know what answers your program should generate (but not to hand this stage in). Write a program that computes and displays the following results. Your program should compute and display the results for the following expressions: expression 1: myld + nLet expression 2: myld -nLet expression 3: myld / 2 expression 4: myld % 2 expression 5: nLet+nLet* 2 expression 6: (myld)/(nLet + 1100) Write a Java program that computes and displays the results of these six expressions.
I need help with this lab please help me
I ask before but they provide the wrong code.
![Understand the Application
You will create two int variables, myld and nLet, into which you will store:
myld = The sum of the numbers in your College Generated student ID (GID). (This is the sum of an 7-digit number;
not to confuse it with your social security # or a password, which it is not).
• nLet The number of letters in your family (last) name.
In order to receive any credit for this assignment, these two values must match what I have for you on my class roster.
Your program will compute some values based on these two numbers, so that each student will have a unique output.
The Program Spec
The following expressions assume that you have stored the sum of the numbers of your student ID into the
variable myld, and the number of letters in your last (family) name into the variable nLet. No user input allowed.
Rather, declare and assign these variables before computing the following values.
●
First do the math on paper so you know what answers your program should generate (but not to hand this stage in).
Write a program that computes and displays the following results.
Your program should compute and display the results for the following expressions:
myld + nLet
myld - nLet
myld / 2
myld % 2
expression1:
expression 2:
expression 3:
expression 4:
expression 5:
expression 6:
(myld) / (nLet + 1100)
Write a Java program that computes and displays the results of these six expressions.
nLet+nLet * 2](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F31cbd9c9-e4f3-4ba4-a3e9-280541e49d5f%2F81bbbd32-6b62-42cc-920e-b624c9d9c970%2F0bj3ohm_processed.png&w=3840&q=75)
![Your program display should look something like this (although the values will differ for each student):
My family name is: Student
My student id is: 12345678
myId is: 36
nLet is: 7
Expression #1 --> 43
Expression # 2 --> 29
Expression # 3 --> 18.0
Expression # 4 --> 0
Expression # 5 --> 21
Expression #6 --> 0.03252
Your exact output does not have to look like the example display above. For example, the part, "Expression #N --
>" can be the actual expression or some other wording. Note that the first two lines are output statements to display
the values you have assigned to the variable myld and numLet; the following lines are output from your program run.
This should all be done in one run of a single program, not several runs.
Here are some REQUIREMENTS:
1. Assign personal information (family name, student id) to String variables.
2. Hardcode values for myld and nLet.
3. Assign the arithmetic expression results to a variable. Use as few variables as possible.
4. Use a space around operators.
5. Perform the necessary data conversions to perform arithmetic operations.
6. As you can see in the sample run, the first thing your program needs to do is print out the values for your family
(last) name and your student ID.
7. Ensure that your solution is well organized. Providing comments to organize your source code is recommended.
8. Format floating point numbers to 1 decimal place for expression 3 and to 5 decimal places for expression 6.
9. Title your program filename to read ArithYourLastName (e.g. for the example run provided the class name would be
ArithStudent.java).
.O. Only one run, please, which means you must produce all six answers in your program in a single source file.
.1. Expressions #1, #2 #4 and #5 should use ordinary int arithmetic, which means using the int variables without any
special tools. However, expressions #3 and #6 are meant to display the double accuracy that the divisions will
produce, You should take appropriate action to do that.
.2. Use as few variables as possible. You can, for example, use one intResult variable for the four int expressions and a
second doubleResult variable for the two double expressions. However, not to use six separate result variables.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F31cbd9c9-e4f3-4ba4-a3e9-280541e49d5f%2F81bbbd32-6b62-42cc-920e-b624c9d9c970%2Fapz7x5i_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
1. Declare and initialize two String variables:
- `familyName` with the value "Student"
- `studentID` with the value "12345678"
2. Declare and initialize two integer variables:
- `myId` with the value 36
- `nLet` with the value 7
3. Print the family name and student ID:
- Print "My family name is : " followed by the value of `familyName`
- Print "My student id is : " followed by the value of `studentID`
4. Print the values of `myId` and `nLet`:
- Print "myId is : " followed by the value of `myId`
- Print "nLet is : " followed by the value of `nLet`
5. Declare two variables to store arithmetic expression results:
- `intResult` for integer results
- `doubleResult` for double results
6. Calculate and print the results of the following expressions:
- Expression #1: `intResult` = `myId` + `nLet`
- Expression #2: `intResult` = `myId` - `nLet`
- Expression #3: `doubleResult` = `(double) myId / 2`
- Note: Casting to double to ensure accurate division
- Expression #4: `intResult` = `myId` % 2
- Expression #5: `intResult` = `nLet` + `nLet * 2`
- Expression #6: `doubleResult` = `(double) myId / (nLet + 1100)`
- Note: Casting to double to ensure accurate division
- Print the results of each expression with appropriate labels.
End of the algorithm.
Step by step
Solved in 5 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)