"<« z <
Q: System.out.print("Enter a positive integer value"); int x input.nextInt(); int n = 03; if(x 1500) %...
A: 300
Q: 4. The following diagram shows the TCP connection handshake. For each of the 3 messages in the hands...
A: Lets determine what is given and what needs to be determined. We are given TCP handshake diagram bet...
Q: i know that class A: def __init__(self): self.x = 0 class B(A): def __init__(self): super().__init_...
A: the super function
Q: Discuss memory representations of 1D and 2D arrays with the help of suitableexamples
A: Memory representations of 1D array A 1-D array is a group or set of similar type elements that must ...
Q: The MVC architecture style ensures that the view has very low coupling with the model and controller...
A: True
Q: i. Explain four factors that your company shouldconsider before (or when) sourcing for computerhardw...
A: Sourcing computer hardware is an investment so it must be done wisely. Whether it’s a desktop or lap...
Q: Consider a directed graph with n vertices that is represented using an adjacency list. Describe an a...
A: Let us Consider Directed Graph with n vertices represented by adjacency list. In these representatio...
Q: List and explain at least 2 factors that will cause a discrepancy between promised bandwidth and obs...
A: The factors that cause the promised bandwidth to the observed throughput to differ are:- Transmissio...
Q: In c++ write a function, reverseDigit, that takes an integer as a parameter and returns the number w...
A: Code: #include <iostream> using namespace std; int reverseDigit(int);//declaring the funct...
Q: list and describe 10 international information technology/computer science associations
A: Computer Science associations: 1.International Association for Computer Information Systems(IACIS): ...
Q: Question No.2 Marks (10) Draw the logic diagram and truth table of the following equation using logi...
A: Let us first simplify the given expression- [(AB)'B']+[A(C+A)]=[(A'+B')B']+AC+A]=A'B'+B'+A(C+1)=B'(A...
Q: Please help me with this coding and also please give explanation. It would be great if you can scree...
A: Algorithm Explanation Smallest difference in a list can be found out by checking the difference of e...
Q: In Python: Create a function Matrix_transpose() utilizing List comprehension techniques that takes a...
A: #Define a function to return the transpose of the original def Matrix_transpose(twoDlist): if no...
Q: Write a C++ program that accepts a number followed by one space and then a letter. If the letter fol...
A: Approach: We used if else-if ladder to display the required result Prompt user to enter the number ...
Q: Question 2a. From an end-user perspective, any SQL-based relational database application involves th...
A: SQL RDBMS from user perspective. User interface: The user interface aptly works as it is named it a...
Q: Adress line
A: since we have 256M (2^8=256) we will need 8 lines.
Q: C programing language
A: The arrays can be simply passed by pass by reference and the changes are directly affected on origin...
Q: Explain the deployment and operational view, resources, services, virtual entities, users in an IoT ...
A: Innovative clients, optimization and automation focused on results, digital transformation, R&D ...
Q: 4. Consider the following linked list: first 10 12 14 16 18 struct Node Txpe ( int val Nadetxne" lin...
A: For finding sum of all existing nodes traverse the linked list until it do not points to NULL value....
Q: Critically analyze the two modes of asynchronous data transfer techniques accompanied by suitable di...
A: The synchronous or asynchronous, serial communication between the microprocessors and the O-devices ...
Q: Object-Orineted Programming [Using Java Language] ==================================== Question - 5
A: Program code: //import the required packagesimport java.util.Scanner;//define a class Mainpublic cla...
Q: Create a structure called applianceTYpe with the following members. Use the proper variable TYPES fo...
A: Creating Structure: //Create a structure struct applianceType{ //USe the proper variable types f...
Q: C++ programing
A: The code is in C++ struct applianceType // create structure { string name; int ...
Q: If int1 has a value 12, int2 has a value 18, int3 has a value 21, What result of each of the followi...
A: Part (A) Given; int1 = 12 int2 = 18 int3 = 21 Now, the term int1<int2 results in 1 as the value ...
Q: Write JAVA method for the following composition of Transformation a) Successive Translation b)Succe...
A: Transformation.In computer graphics, transformation of the coordinates consists of three major proce...
Q: Quicksort SPLIT (the 2-pointer algorithm covered in class) is applied to the integer array [4,3,5,7,...
A:
Q: What is the output of the following program and show all your workings? public class Main{public sta...
A: OUTPUT OUTPUT EXPLAINED mystery(5) called ie. num = 5 num not less than / equal to 1 so else blo...
Q: a) Suppose two threads T1 and T2 are running concurrently in the same process with a single CPU. S...
A: Two threads T1 and T2 are running concurrently in the same process with a single CPU. Suppose T1 d...
Q: WORLD SERIES (C++) Code two functions to fill an array with the names of every World Series winnin...
A: C++ provides a data structure, the array, which stores a fixed-size sequential collection of element...
Q: 2. What is the minimum number of MIPS assembly instructions needed to write if (a<b) then c = 1; els...
A: 4
Q: identify characteristics of the time-sharing and distributed operating systems and write a paragraph...
A: Characteristics of Time-sharing operating system:- 1. The operating system Time-Sharing allows many ...
Q: Where could cloud computing fit in the organizational structure and operations?
A: With the cloud, information travels rapidly in both directions, across computing systems that, with ...
Q: Explain Abstract Class, Abstract method, and Interface in Java? Write any program that gives example...
A: Abstract Class A class which is declared with the abstract keyword is known as an abstract class in...
Q: You are given a collection of n bolts of different widths and n corresponding nuts. You are allowed ...
A: Given, Number of bolts =n and the number of nuts=n There cannot be a comparison between nuts and b...
Q: Write a C program which should handle books information for a book shop. It should be able to handle...
A: class book{ char bno[6]; char bname[50]; char aname[20]; public: void create_book() { cou...
Q: binary heap implementation in c programming
A: /* C program to build a binary heap */ #include <stdio.h>#include <stdlib.h>#define MAX ...
Q: 1. What are the three main purposes of an operating system? 2 .We have stressed the need for an oper...
A: 1. Operating System (OS) is an interface between a computer user and computer hardware. There are ma...
Q: Your task is to develop a database, in order to keep information on all sales at a motorcycle dealer...
A: The shared description states the requirements of the database model for sales for a motorcycle deal...
Q: The following database is maintained by a bookstore: the database structure is shown below. AUTHOR(A...
A: CREATE TABLE Author(AuthorName text primary key); INSERT INTO Author VALUES('Author1');INSERT INTO A...
Q: Please answer step by step and thank you so much! Complete the following addition in base-2: 1011 + ...
A: 1011 +0110 10001
Q: List and describe 10 local/national information technology/computer science associations
A: Information technology is the utilization of PCs to store, recover, send, and control information . ...
Explanation
In this Program, we have used both call by value and call by reference.
while passing x to function we used call by value so actual value doesn't change. so x value will be 1
while calculating the y value we are using its actual address.
so in function following calculation will take place
c=1+1 =>2
a=1 * 2 => 2
b=2 + 2 + 2 => 6 It is y's actual value
And at last z value which local to main() which is 2
Final Output will be 1 6 2
Step by step
Solved in 2 steps with 2 images
- Give the output of the following program assuming static scoping #include <iostream> using namespace std; int total = 5; int c = 3; int fun1(int); int fun2(int); int main() { int x = 2; int y = 8; cout << " variables x y and c have values: " << x <<" " << y << " " << c << endl; cout << "main: fun1(x) = " << fun1(x) << endl; cout << " After Call to fun1(x) variables x y and c have values: " << x <<" " << y << " " << c << endl; return 0; } int fun1(int a) { int b = 6; int c = 3; b = total + c + a; cout << "in fun1: b= " << b << endl; cout << "in fun 1 after call to fun2(total) the return value is " << fun2(total) << endl; return (b); } int fun2(int w) { c = c * 2; total = total + w + c; cout << "in fun2: total= " << total << endl; return(c); }Assume the following declarations and initializations (MIN, MAX, num) are made justbefore each sub-question 1 to 15 (i.e., assume these initializations are in effect at thebeginning of each problem). What is the output each code? final int MIN = 10, MAX = 20;int num = 15; 8. do {num = num + 1;if (num * 2 > MAX + num)System.out.print(num + “ “);} while (num <= MAX); 9. for (int value = 0; value >= 7; value++)System.out.print(value + “ “); 10. for (int value = 7; value < 0; value--)System.out.print(value + “ “); 11. for (int value = 1; value >= 20; value+=4)System.out.print(value + “ “);QUESTION: If the second input is higher than the first input but lower than the third input, what will be the output results? Write on the space provided the input values and the results. A young boy wants to create a program in block of code that will compute for the quadratic equation then print the result. The main function composes of the input variables.The formula is given below: -B ± √ B ^2 – 4AC--------------------------------- 2AIf the user inputs zero (0), the program will display “Invalid Entry” and return to main menu to input another valid numbers.
- If you run the following program, in which order the statements of this program will be executed? Your answer should be a sequence of comma separated line numbers without any extra spaces, e.g., 1,2,3,4,5,6,7,8 etc.You are creating an application which requires the user to input the precise height of their garage (in metres) to determine which trucks will fit. Input is accepted using the input() function. What is the most appropriate approach to writing the code for type conversion of the input value and why? a. No type conversion necessary, since the Python interpreter will determine the best type for the value implicitly. b. Convert to int, since fractional number input values are valid. c. Convert to float, since fractional number input values are valid. d. No type conversion necessary, since the input will already be the appropriate type for numbers. e. Convert to float, since only whole number input values are valid. f. Convert to int, since only whole number input values are valid.Consider the following program in which the statements are in the incorrect order. Rearrange the statements in the following order so that the program prompts the user to input: The height of the base of a cylinder The radius of the base of a cylinder The program then outputs (in order): The volume of the cylinder. The surface area of the cylinder Format the output to two decimal places. #include <iomanip> #include <cmath> int main() {} double height; cout << "Volume of the cylinder = " << PI * pow(radius, 2.0) * height << endl; cout << "Enter the height of the cylinder: "; cin >> radius; cout << endl; return 0; double radius; cout << "Surface area: " << 2 * PI * radius * height + 2 * PI * pow(radius, 2.0) << endl; cout << fixed << showpoint << setprecision(2); cout << "Enter the radius of the base of the cylinder: "; cin >> height; cout << endl; #include <iostream> const…
- Hi, I need help with the following assignment. Implement a program that reads in a year and outputs the approximate value of a Ferrari 250 GTO in that year. Use the following table that describes the estimated value of a GTO at different times since 1962. Year Value 1962-1964 $18,500 1965-1968 $6,000 1969-1971 $12,000 1972-1975 $48,000 1976-1980 $200,000 1981-1985 $650,000 1986-2012 $35,000,000 2013-2014 $52,000,000QUESTION: 2. If the third input is first than the second input but lower than the first input, what will be the output results? Write on the space provided the input values and the results. A young boy wants to create a program in block of code that will compute for the quadratic equation then print the result. The main function composes of the input variables.The formula is given below: -B ± √ B ^2 – 4AC--------------------------------- 2A If the user inputs zero (0), the program will display “Invalid Entry” and return to main menu to input another valid numbers.Question R .Consider the program segment below : #include <stdio.h> void guess (int,int); int main() { int a = 100, b = 200; int c; printf (“a is %d, b is %d\n”, a, b); guess (a, b); printf (“a is %d, b is %d\n”, a, b); return 0; } void guess (int x, int y) { int value; value = x; x = y; y = value; printf (“x is %d, y is %d\n”, x, y); } A. Identify the function call, the function header and the function prototype. B. What is the data type of x? C. Determine the output. Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this line
- (in Python) Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 50 miles, and 400 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('{:.2f}'.format(your_value)) Ex: If the input is: 20.0 3.1599 the output is: 1.58 7.90 63.20 Your program must define and call the following driving_cost() function. Given input parameters driven_miles, miles_per_gallon, and dollars_per_gallon, the function returns the dollar cost to drive those miles. Ex: If the function is called with: 50 20.0 3.1599 the function returns: 7.89975 def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon) Your program should call the function three times to determine the gas cost for 10 miles, 50 miles, and 400 miles.Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 50 miles, and 400 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('%0.2f' % your_value) Ex: If the input is: 20.0 3.1599 the output is: 1.58 7.90 63.20 Your program must define and call the following driving_cost() function. Given input parameters driven_miles, miles_per_gallon, and dollars_per_gallon, the function returns the dollar cost to drive those miles. Ex: If the function is called with: 50 20.0 3.1599 the function returns: 7.89975 def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon) Your program should call the function three times to determine the gas cost for 10 miles, 50 miles, and 400 miles. Note: This is a lab from a previous chapter that now requires the use of a function.The steelwork.py program, given below, creates three types of steel objects. Carbon steel (Steel) is made of carbon and iron, alloy steel (AlloySteel) contains chromium in addition to carbon and iron. Stainless steel (StainlessSteel) contains nickel and a higher proportion of chromium. Write the missing code, in the designated locations (#TODO), in order for the program execution to yield the following output: ['Steel01', 0.6, 91] ['ALSteel02', 0.6, 91, 1] ['SSteel02', 0.6, 91, 11, 2]