What is the output of the following program? (Show your work)

int x = 3, y = 2;
System.out.println("x = " + y);

x = 5 + y * 7 % 3;


y = x - y * x - 3 / 2;


System.out.println("x = " + x);
System.out.println("y = " + y);

Answers

Answer 1

Answer:

x = 2

x = 7

y = -8

Explanation:

int x = 3; (here the variable of type int called x is declared and given the value 3)

int y = 2; (here another variable of type int called y is declared and given the value 2;

System.out.println("x = " +y ); (this instruction will print the value of y in the console terminal but deceivingly saying that the value belongs to x variable. So whoever reads will read "x = 2" instead of "x = 3" which would be the correct value associated with x.

x = 5 + y * 7 % 3; (here the value of x is changed from 3 to 5 + y * 7 % 3. What this means is that the first value of y (2) is multiplied by 7 and then get the mod of division 14 / 3 which is 2. Then added to 5. So the final result is 7 which is now the new value of x)

y = x - y * x - 3 / 2 (same as the above but for the value of y: here - 2 is multiplied by 7 and - 3 is divided by 2. Now we have 7 - 14 - 1.5 which is -8.5 but since you specified the variable type was an int and not double or float, then the program ignores significant numbers, so it ignores the .5 or whatever comes after the point instead of rounding it. PS: [So for instance if the result was 8.9, the value printed would be 8])

System.out.println("x = " + x); (prints the new value of x but this time it does not deceive the reader)

System.out.println("y = " + y); (prints the new value of y, and the letter y is shown in the screen for the first time with the correct value associated)


Related Questions

A programmer wants to determine whether a score is within 10 points of a given target. For example, if the target is 50, then the scores 40, 44, 50, 58, and 60 are all within 10 points of the target, while 38 and 61 are not.

Which of the following Boolean expressions will evaluate to true if and only if score is within 10 points of target ?

Answers

Answer:

(target - 10 ≤ score) AND (score ≤ target + 10)

Explanation:

(target - 10 ≤ score) AND (score ≤ target + 10).

What are Boolean expression?

A logical assertion that can only be TRUE or FALSE is known as a Boolean expression. As long as both sides of the expression have the same fundamental data type, boolean expressions can compare data of any kind.

Oracle OLAP evaluates this expression by comparing each value of the variable actual to the fixed value 20,000.

Unless parentheses indicate a different evaluation order, operators with equal priorities are evaluated from left to right. When the truth value has been determined, the evaluation is stopped.

Therefore, (target - 10 ≤ score) AND (score ≤ target + 10).

To learn more about Boolean expressions, refer to the link:

https://brainly.com/question/13265286

#SPJ6

write the importance of software In computer ​

Answers

Answer:

Microsoft word, Excel, Access, Power point, Microsoft windows...........

Explanation:

PLSS HELP ASAP ILL GIVE BRAINLIEST THANKS

Answers

Answer:

I think division I am not sure

Explanation:

but hope that helps

Box. Atleast thats what my class calls it.

25 POINTS!!! 3 OPTIONS!!
Democratic governments may put financial and regulatory pressure on unsupportive media outlets but offer supportive media outlets _____. Select 3 options.

A. unfavorable coverage

B. negative publicity

C. preferential access to information

D. lucrative contracts

E. favorable regulatory decisions

Answers

Answer:

C. Preferential Access to Information

D. Lucrative Contracts

E. favorable regulatory decisions

Explanation:

Edge 2021

The democracy govenment may put financial and regulatory pressure by

preferential Access to Informationlucrative Contractsfavorable regulatory decisions.What is a democratic government ?

The democratic government is the form of the government in which the power is given to the people to decide or to deliberate and form the legislation.

It allows for the selecting of the governing officials and puts the financial and the regulatory pressure on the unsupported media outlets.

Find out more information about democratic governments.

brainly.com/question/26622333

suggest any complete anime......?​

Answers

Plastic love and maybe your lie in April?

If you clean your camera’s lens incorrectly, what might you damage?

Group of answers:

1. the aperture port
2. the outer coating
3. the inner coating
4. the battery port

Answers

Answer:

2. the outer coating

Answer:

Its number 2 the outer coating

Explanation:

Activity Sheet 2
A.Illustrate how to create the object below using draw and modify commands.​

Answers

Answer:

Vjfxfffccvvvvvv

Explanation:

Hgvjhgxxgyjjbvccjkn Hugh bună vvvvhg un www buukbbchfcvbvc. Hggvhhvbhchgx

the term __________ refers to the expression that defines the quantity to be maximized or minimized in a linear programming model.

Answers

The answer is: objective function.

the term “objective function” refers to the expression that defines the quantity to be maximized or minimized in a linear programming model.

the term objective function refers to the expression that defines the quantity to be maximized or minimized in a linear programming model.

What is objective function?

The objective function is a mathematical equation that describes the target production output that corresponds to profit maximization in relation to production.

It then uses the correlation of variables to calculate the final outcome value. Based on a collection of constraints and the relationship between one or more decision variables, an objective function attempts to maximize profits or minimize losses.

Therefore, In a linear programming model, the term objective function refers to the expression that defines the quantity to be maximized or minimized.

Learn more about the objective function, refer to:

https://brainly.com/question/29185392

#SPJ5

Que compone una maquina Rube Goldberg (operadores mecánicos- maquinas simples – mecanismos)

Answers

Answer:

dominoes, fans, PVC pipe, magnets, duct tape, marbles, cups or bowls, miniature toy cars, paper towel tubes, string.

------------------------------------------------------------------------------------------------------------

dominó, abanicos, tubos de PVC, imanes, cinta adhesiva, canicas, tazas o cuencos, carros de juguete en miniatura, tubos de toallas de papel, cuerdas.

Explanation:

What is the difference between asset allocation and diversification

Answers

Answer:

Asset allocation refers to the percentage of stocks, bonds, and cash in your portfolio. In contrast, diversification describes the spreading of your assets across the various asset classes within each of those three allocation buckets to further reduce risk.

Explanation:

Think about the different costs for magazine ads. Why do you think it would cost more to have an ad placed on the front or back of the magazine instead of having it inside?

Answers

People or businesses usually buy ads to promote what they’re trying to sell. Since the front and back of the magazine is what people see the most (rather than some random page on the inside), it is expected that an ad on one of the covers would cost more since those surfaces get many more viewers on average.

Hope this helps!

Which statement is true with respect to Java?

A.
Java programs are not compiled, only interpreted.

B.
Intermediate bytecode is created by the JIT.

C.
Bytecode is platform independent.

D.
The JVM creates object code after compiling.

Answers

Java is a high level programming language.

The true statement is (c) Bytecode is platform independent.

First, java programs are compiled and interpreted

This means that (a) is not true

Secondly Just-In-Time (JIT) does not create intermediate bytecodes, and Java virtual machine (JVM) does not create object codes.

However, java programs are compiled to an instruction set for the JVM; this instruction set is referred to as the byte code.

And the byte code is platform-independent.

Hence, the true option is (c)

Read more about java programming language at:

https://brainly.com/question/2266606

Answer:

C) Bytecode is platform independent

Explanation:

Just got it right on ASU

Your computer has a software problem. Which of the following will NOT help you fix your 3 issue?

A- remove all media from drives
B- run anti-virus software
C- reinstall the operating system
D- install pirated software ​

Answers

Answer:

D- install pirated software ​

Explanation:

Installing pirated software (depending on where you get it from) will most likely cause more harm than help.

Hoá học 9 giải hộ mềnh vơiz:))

Answers

Answer:

sorry di ko alam

What does the value 0.5 specify in the following code?rgba(123,12,11,0.5)

Answers

The last number in the code?

Why is this happening when I already uploaded files to my drive?

Answers

Answer:

u have to upload it to your drive first

Explanation:

please help me i will mark as brainliest​

Answers

Answer:

1 True

2 True

3 False

4 True

5 True

— hope I helped you

Question 14 of 20
"Businesses around the world all need access to the same data, so there
needs to be one type of information system that is designed to offer it." Why
is this statement false?
O A. This statement is false because there already is only one type of
information system.
B. This statement is false because the data that the Internet
produces is never the same.
1
O C. This statement is false because different businesses have
different information needs.
O D. This statement is in fact correct; this is where the field of
information technology is heading.
SUBMIT

Answers

Answer:

This statement is false because there already is only one type of

information system.

suggest me anime genre : adventure ecchi​

Answers

HUMAGUSHIE that’s is the genre of ADVENTURE ECCHI

A processor's speed is measured in megahertz (MHz), or millions of instructions per second; and gigahertz (GHz), or billions of instructions per second. Which processor is faster?

options:

3.8 GHz


3.8 MHz

Answers

Answer:

3.8 GHz

Explanation:

GHz (gigahertz, or billions of pulses per second).

The faster processor speed can be 3.8 GHz. The first option is correct.

What is speed?

The speed of any moving object is the ratio of the distance covered and the time taken to cover that distance.

A processor's speed is measured in megahertz (MHz), or millions of instructions per second; and gigahertz (GHz), or billions of instructions per second.

The billions of instructions per second is greater than millions of instructions per second.

Thus,  3.8 GHz is faster.

Learn more about speed.

brainly.com/question/7359669

#SPJ2

If Maya wants to access a view that would control multiple slides within a presentation, which view should she utilize?

*it's A. Master view edg

Answers

Answer:

a. Master view

Explanation: is correct. post protected.

Good things to keep track of about people in your Career Network include: a. contact information, including how to spell their name. b. how you came to know them (introduced by a friend, at a career fair, search on LinkedIn, etc.). c. notes about your last interaction and plans for your next interaction. d. only a and b above e. all of the above

Answers

Answer:

mi pareceres que es la B

Explanation:

How Powerpoint is useful in education aspect?

Answers

Answer:

(Hope this helps can I pls have brainlist (crown)☺️)

Explanation:

PowerPoint may be a useful tool in the classroom for presenting content and encouraging student learning. PowerPoint may be used to present graphics that would be difficult to bring to class otherwise. PowerPoint may be a useful tool in the classroom for presenting content and encouraging student learning.

It improves learning by giving pupils a greater comprehension of the subject and inspiring them. It meant that technology-based instruction had a considerable favourable impact on students' grades. Analyses revealed that the experimental group students outperformed the control group.

A two-dimensional array of ints with 4 rows, has been created and assigned to a2d. Write an expression whose value is the total number of ints that could be stored in the entire array.

Answers

Arrays are used to represent data in rows and columns

The expression that represents the number of int the array can store is 4c

From the question, we have:

The number of rows is given as: 4The number of columns is unknown; assume the number of columns to be c.

Also from the question, we understand that the array is of integer type.

So, the number (n) of int the array can store is the product of the rows and the columns

i.e.

[tex]\mathbf{n = Rows \times Column}[/tex]

So, we have:

[tex]\mathbf{n = 4\times c}[/tex]

Multiply

[tex]\mathbf{n = 4c}[/tex]

Hence, the expression that represents the number of int the array can store is 4c

Read more about arrays at:

https://brainly.com/question/14664712

b. Differentiate Operation System from other software. give me 4-5 sentences pls.

Answers

Answer:

An operating system or OS is system software that manages computer hardware, software resources, and provides common services for computer programs. All operating systems are system software. Every desktop computer, tablet, and smartphone includes an operating system that provides basic functionality for the device while on the other hand The System software is a type of computer program that is designed to run a computer’s hardware and application programs it controls a computer’s internal functioning, chiefly through an operating system. It also controls peripherals devices such as monitors, printers, and storage devices.

Explanation:

what do other people think of e.t
in the movie E.T

Answers

Answer:

I think E.T is funny

Explanation:

Digital photography occurred in what age?

Answers

Answer:

The history of digital photography as we know it began in the 1950s. In 1951, the first digital signals were saved to magnetic tape via the first video tape recorder. Six years later, in 1957, the first digital image was produced through a computer by Russell Kirsch.

Dom is a software developer who likes to tweak his computer's OS to make it work the way he wants it to. The OS he is most likely to use is _____.

A. Mac
B. Linux
C. MS-DOS
D. Windows

Answers

Answer:

Linux

Explanation:

Linux-based operating systems are open-source, and open-source software can be modified. Mac, MS-DOS, and Windows are all closed-source means we can't see the source code hence we can't modify it.

I hope this helps <3

What areas does ABET provide accreditation?
students
programs
institutions
teaching staff
industries

Answers

It is a form of quality assurance for programs in the areas of applied and natural science, computing, engineering, and engineering technology. Our accreditation is recognized globally as evidence that a program meets the standards set by its technical profession.

"We are a nonprofit, non-governmental agency that accredits programs in applied and natural science, computing, engineering and engineering technology." - ABET

Can anyone lend me a computer?

Answers

Answer: No

Explanation:

Answer:

no

Explanation:

Other Questions
What three groups helped creat the population growth in the colonies Solve 8T 1398lb 14oz * 6 Can we find living mitochondria in a dead cell? Ms. Henderson's plant is 613 inches tall. It is 156 inches taller than Megan's plant.How tall is Megan's plant? help - does anyone know how to calculate the gradient of this? Which statement correctly explains how matter is conserved in chemical reactions? (1 point) Which of the following is true about cells?A. A cells components are all identical and perform the same function.B. Cells have specialized components that all perform the same functions.C. A cell has a single component that performs all of the cells different, specific functions.D. Cells have specialized components that perform different, specific functions. What is frequency? What is a good rule of thumb to remember when you create your fitness program and frequency?test is timed hurryy Which cycle involves a gas moving from the atmosphere moving directly intoplants? which was the first fast food company to invest in artificial intelligence? Helppp pleasee ........ What is an example of microorganisms acting in a harmful way? in the united states, in 2010, what was the primary mode of transmission for hiv/aids for women? Pls help will mark brainliest if i can Describe the plot of the William Tell story. Use complete sentences.A. Problem:B. Action:C. Climax:D. Outcome: What is the density of an object that has a mass of 1.08 kg and displaces 50.50 cm3 of water? (Please report your answer in g/cm3 ) Please report your answer in decimal notation not scientific notation the computer will mark it incorrect. what time is the ohio state michigan game on saturday The elements named in honor of France, America, Poland and Germany are (1) The company of a good friend has brought... a great change in him. Hi! I've got to write a story that begins with this sentence: I woke up feeling sad because it was the last day of my holiday.The story must include a surprise that I've had on my holiday. There must be also beach and a competition.I would be very grateful if you give me some ideas because I find it difficult to make up such a story.P.S Sorry if there are any mistakes but I am not a native speaker. :) Select the correct answer.What is ?A. B. C. D.