1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kazeer [188]
4 years ago
13

1. JAVA Create one method to do the following expressions. Given the following declarations, what is the result of each of the e

xpressions
int w = 2, y = 7, z = 12;

a. w * z
b. w * z + y
c. w * -z
d. w * --z + y++
e. w * z-- + ++y
f. w + z * y
g. w – y + z
h. (w + y) * z
i. y / w
j. y / z
k. w % y
l. y % w
Computers and Technology
1 answer:
nordsb [41]4 years ago
7 0
<span>public void myMethod(int w, int y, int z) {
</span>int a, b, c, d, e, f, g, h, i, j, k, l;

<span>a = w * z;
</span>b = w * z + y;
c = w * -z;
d = w * --z + y++;
e = w * z-- + ++y<span> ;
</span>f = w + z * y;
g =  w – y + z;
h = (w + y) * z;
i = y / w;
j = y / z;
k = w % y;
<span>l = y % w;
</span>System.out.println( "%d %d %d %d %d %d %d %d %d %d %d %d", a,b,c,d,e,f,g,h,i,j,k);
}

To use 
myMethod(2, 7, 12);
You might be interested in
Let’s use that simple branch instruction to do the following: Load the two words declared in the data statement shown to the rig
mr Goodwill [35]

It prints first number.

Second number is negative and its value is: -1744764930

<u>Explanation:</u>

Required code is below.

========================================================================

.data

  data1:   .word   0x0001ead7

  data2:   .word   0x9800fffe

.text

main:   # load first number in to register $a0

  lw $a0, data1

  # if number is positive print it out

  bgez $a0, print

  # load second number in to register $a0

second:   lw $a0, data2

  # if number is positive print it out

  bgez $a0, print

  # end program

  li $v0, 10

  syscall    

print:   # print the given number

  li $v0, 1

  syscall

  # go back to main program

  j second

6 0
4 years ago
Need some help writing a simple PYTHON Student registration program:
Y_Kistochka [10]

import random

database = {}

while True:

   try:

       user_choice = int(input("Enter your student id to bring up your information (Press enter if you don't have one) : "))

       if user_choice in database:

           print("Student ID:",database[user_choice][0],"\nFirst name:",database[user_choice][1],"\nLast name:",database[user_choice][2],"\nPhone number:",database[user_choice][3],"\nEmail address:",database[user_choice][4],"\nPassword:",database[user_choice][5],"\nPoints:",database[user_choice][6])

   except ValueError:

       name = input("Enter your first name: ")

       last_name = input("Enter your last name: ")

       phone_number = input("Enter your phone number: ")

       email = input("Enter your email address: ")

       password = input("Enter a password: ")

       points = 100

       student_id = random.randint(1,1000)

       while student_id in database:

           student_id = random.randint(1,1000)

       print("Hello,",name,"your student ID is:",student_id)

       database[student_id] = [student_id,name, last_name, phone_number, email, password, points]

I wrote my code in python 3.8. I hope this helps.

6 0
3 years ago
What is a burned edge ?
scoray [572]

Answer: IT IS A DARK FEATHERED EDGE AROUND AN IMAGE

Explanation:

8 0
4 years ago
Bloodborne pathogens travel by way of blood cells and can only be spread by person-to-person contact with infected blood
Eva8 [605]
That is incorrect. It is only contagious if blood is injected into person who is not infected.
5 0
3 years ago
Read 2 more answers
What is ms- power point?​
WITCHER [35]

Answer:

Microsoft PowerPoint is a powerful slide show presentation program. It is a standard component of the company's Microsoft Office suite software, and is bundled together with Word, Excel, and other office productivity tools. The program uses slides to convey information rich in multimedia.

hope it work️

5 0
4 years ago
Read 2 more answers
Other questions:
  • Designing the moving parts of a car—including the engine, drivetrain, steering, and brakes—is done by what type of engineer?
    11·2 answers
  • What are some considerations when backing up data to the cloud?
    10·1 answer
  • design the psuedocode for a program that allows a user to enter 10 numbers, then displays them in the reverse order of their ent
    6·1 answer
  • Which type of microphone uses two metal plates?
    7·1 answer
  • SOMETHING WRONG WHAT WRONG!!!!!!!
    15·2 answers
  • It is believed that Taiwan is the original home of these early Oceania explorers. Maori Lapita Polynesians Aborigines
    13·2 answers
  • When light does not pass through or bounce off an object, it is said to be
    13·2 answers
  • Which of the following statements is NOT true regarding the Security Configuration and Analysis (SCA) tool?
    12·1 answer
  • Why do we need to know the different Networking Devices?​
    10·1 answer
  • Which step do you think is most useful from big data life cycle and why?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!