Building Java Programs: A Back to Basics Approach (4th Edition)
Building Java Programs: A Back to Basics Approach (4th Edition)
4th Edition
ISBN: 9780134322766
Author: Stuart Reges, Marty Stepp
Publisher: PEARSON
Expert Solution & Answer
Book Icon
Chapter 2.1, Problem 3SCP

  a.

Explanation of Solution

  • Given expression is 2 + 3 * 4 - 6.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, multipl...

  b.

Explanation of Solution

  • Given expression is 14 / 7 * 2 + 30 / 5 + 1.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, m...

  c.

Explanation of Solution

  • Given expression is (12 + 3) / 4 * 2.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, multiplication, addition and subtraction from left to right...

  d.

Explanation of Solution

  • Given expression is (238 % 10 + 3) % 7.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, multiplicat...

  e.

Explanation of Solution

  • Given expression is (18 – 7) * (43 % 10).
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, multiplication, a...

  f.

Explanation of Solution

  • Given expression is 2 + 19 % 5 – (11 * (5 / 2))
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, multiplication,...

  g.

Explanation of Solution

  • Given expression is 813 % 100 / 3 + 2.4.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, multi...

  h.

Explanation of Solution

  • Given expression is 26 % 10 % 4 * 3.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division,...

  i.

Explanation of Solution

  • Given expression is 22 + 4 * 2.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, m...

  j.

Explanation of Solution

  • Given expression is 23 % 8 % 3.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then divi...

  k.

Explanation of Solution

  • Given expression is 12 – 2 – 3.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and...

  l.

Explanation of Solution

  • Given expression is 6 / 2 + 7 / 3.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, ...

  m.

Explanation of Solution

  • Given expression is 6 * 7 % 4.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, multipl...

  n.

Explanation of Solution

  • Given expression is 3 * 4 + 2 * 3.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then divisi...

  o.

Explanation of Solution

  • Given expression is 177 % 100 % 10 / 2.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, mul...

  p.

Explanation of Solution

  • Given expression is 89 % (5 + 5) % 5.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, multiplicatio...

  q.

Explanation of Solution

  • Given expression is 392 / 10 % 10 / 2.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division,...

  r.

Explanation of Solution

  • Given expression is 8 * 2 – 7 / 4.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, multip...

  s.

Explanation of Solution

  • Given expression is 37 % 20 % 3 * 4.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, m...

  t.

Explanation of Solution

  • Given expression is 17 % .10 / 4.
  • According to Bodmas rule, if an expression contains brackets then it should be solved first and then division, m...

Blurred answer
Students have asked these similar questions
using rapid miner how to creat decison trea for all attribute and another one with delete one or more of them also how i know the weight of each attribute and what that mean in impact the result
Q.1. Architecture performance [10 marks] Answer A certain microprocessor requires either 2, 4, or 6 machine cycles to perform various operations. ⚫ (40+g+f)% require 2 machine cycles, ⚫ (30-g) % require 4 machine cycles, and ⚫ (30-f)% require 6 machine cycles. (a) What is the average number of machine cycles per instruction for this microprocessor? Answer (b) What is the clock rate (machine cycles per second) required for this microprocessor to be a "1000 MIPS" processor? Answer (c) Suppose that 35% of the instructions require retrieving an operand from memory which needs an extra 8 machine cycles. What is the average number of machine cycles per instruction, including the instructions that fetch operands from memory?
Q.2. Architecture performance [25 marks] Consider two different implementations, M1 and M2, of the same instruction set. M1 has a clock rate of 2 GHz and M2 has a clock rate of 3.3 GHz. There are two classes of instructions with the following CPIs: Class A CPI for M1 CPI for M2 2.f 1.g B 5 3 C 6 4 Note that the dots in 2 fand 1.g indicate decimal points and not multiplication. a) What are the peak MIPS performances for both machines? b) Which implementation is faster, if half the instructions executed in a certain program are from class A, while the rest are divided equally among classes B and C. c) What speedup factor for the execution of class-A instructions would lead to 20% overall speedup? d) What is the maximum possible speedup that can be achieved by only improving the execution of class-A instructions? Explain why. e) What is the clock rate required for microprocessor M1 to be a "1000 MIPS" (not peak MIPS) processor?

Chapter 2 Solutions

Building Java Programs: A Back to Basics Approach (4th Edition)

Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education