Answer : 7. (A) 2.5
Here given expression is 2.5 + 2/4.
2/4 = 0.50 and takes as integer means 2.5 + 0 = 2.5
8.. (C) 0
number1/number2 = 0.5 and its an integer so 0.
9. (A) 0.8
Here number3 is double , hence 0.8 and not 0.
10. (A) 5
number3 + number4 = 5.5 but returns iteger, hence 5.
11. (B) 2.5
returns double.
7. What is the value of this expression: 2.5 2/4 A. 2.5 B 3.0 C. 1...
Question 17 (3 points) Predict the output of the following code segment: a = 99.98 if a + 0.01 >= 100: print('A') elif a + 0.02 >= 100: print('B') print('c') else: print('D') print('E') Question 16 (3 points) Predict the output of the following code segment: X = 6 if x % 2 == 0: print ("x is even.") else: print ("x is odd.") Please use the decimal point to distinguish int and float. For example, number 3 + number 4...
LANGUAGE IS JAVA CALCULATOR USING SCIENTIFIC/STANDARD MODE ERRORS: ADDITION AND DIVISION NOT WORKING FOR EITHER CALCULATOR CODE: import java.util.Scanner; public class CalculatorProject { public static void main (String[] args) { Scanner yurr = new Scanner(System.in); String mode; double i; String choice; String answer = "Y"; while (answer.equals("Y")) { System.out.println("Enter the calculator mode: Standard/Scientific?"); mode = yurr.next(); if(mode.equals("Scientific")) { System.out.print("Enter '+' for addition, '-' for subtractions, '*' for multiplication, '/' for division, 'sin' for sin x, 'cos' for cos x,...
can you answer question 9 please
Problems 473 results from parts (a), (b), and (c). What model seems most plausible? How do the data limit your conclusions? tle the data from Freund (1979), presented in Problem 22 in Chapter 14. Taking be model discussed there as the maximum model, repeat parts (a) through (h) of Problem 6. In part (h), note the possible role of collinearity. A random sample of data was collected on residential sales in a large city....
Matt’s utility is given by u(x1,x2)=min{x1,x2}+min{x3,x4}. Which of the following four bundles (A, B, C, and D) will he most prefer? Bundles are written (x1,x2,x3,x4). a. A = (2, 2, 2, 2) b. B = (6, 0, 0, 2) c. C = (4, 2, 1, 1) d .D = (6, 1, 3, 1)
How would I solve this ???
Assume the declarations: double x[8] = {3.0, 2.0, 8.0, 2.5, -1.0, 5.0, 2.0, 7.0}; int i=4; // initialized Suppose that each of the boldfaced, lettered statements is executed in turn, so that each subsequent statement continues the processing of the preceding statement. Describe what each statement does to the array by showing the contents of the array x after each statement is executed. Write your answers on this sheet and hand it in with...
please code using risc-v language and make it as simple as
possible
Problem 1: (20 marks) Part 1: (15 points) Compile the RISC-V assembly code for the following C code. Assume that n and k are passed in x3 and x4 respectively. Values n and k are initialized to 14 and 14. Assume that result returned in register fl and that double precision numbers are used. After you are done store the result in address: 12(x3). Are you allowed to?...
13. Calculate Altman's Z-score for a firm seeking a loan with the following financial value ratios: x1=.3 x2=0 x3=-.24 x4=.15 x5=1.8 A. 2.416 B. 1.552 C. 1.329 D. 1.458
python
1
import matplotlib.pyplot as plt
2
import numpy as np
3
4
abscissa = np.arange(20)
5
plt.gca().set_prop_cycle(
’
color
’
, [
’
red
’
,
’
green
’
,
’
blue
’
,
’
black
’
])
6
7
class MyLine:
8
9
def __init__(self,
*
args,
**
options):
10
#TO DO: IMPLEMENT FUNCTION
11
pass
12
13
def draw(self):
14
plt.plot(abscissa,self.line(abscissa))
15
16
def get_line(self):
17
return "y = {0:.2f}x + {1:.2f}".format(self.slope,
self.intercept)
18
19
def __str__(self):...
Which of the following types can be safely compared using the == operator? A- string b- float c- double d- Char 2- What will be stored in variable i after the following statement is executed? int i = (int) Math.sqrt(5);
Language is C++ Complete the following Review Questions: 1. This is a control structure that repeats a group of statements in a program? a. loop b. switch c. main() function d. compiler 2. In the expression number++,the ++operator is in what mode? a. Prefix b. Pretest c. Postfix d. Posttest 3.This is a variable that controls the number of iterations performed by a loop. a. Loop control variable b. Accumulator c. Iteration register variable d. Repetition meter 4. The do-whileloop...