Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

3.7 Code Practice
Instructions
When we read code and predict its output, it is called tracing code.

For this lesson, you will come up with your own challenging algorithm for other students to trace. It must contain at least 5 if statements and use at least one AND or OR boolean condition.

Note: Elif or else statements will not count - your statements must be if statements. Each if statement should use a unique variable name.

For this challenge, try reading 3 or 4 of your classmates' code as well. Trace their code and predict what it will output, then check the code by running it to see if you got it right, and submit your work for a grade.
Given a nxm matrix containing the m temperatures of a city measured in n days, implement a function that takes in input this matrix and calculate the daily averages of temperatures, storing them in a vector. The carrier shall then be re-read and the minimum and maximum average temperature printed, specifying the day on which it occurred. (use just iostream)
Write a function declaration for a function called grader that takes a numeric score and returns a letter grade. Grade has one argument of type integer. Use the rule that 90 to 100 is an A, 80 to 89 is a B, 70 to 79 is a C and less than 70 is an F. (20 points)
What is printed by the Python code?
x = 5
y = x + 3
x = x - 1
z = 10
x = x + z
print('x: {}, y: {}, z: {}'.format(x, y, z))
Write a structured algorithm to prompt the user to input the ages of four friends. The algorithm should allow the user to input the ages, find and print the average.
Write a structured algorithm to prompt the user to enter the length of a square. Calculate and output the area of the square.
In a company, the customers had to wait in rows due to the technical issues in the company’s software. Now the company has decided that it will reimburse some amount from their paid amount to the customers as compensation since they had to wait for long.
 The software takes time as input in minutes. This time is to be converted into hours and for each complete hour an amount of Rs. 50 is to be reimbursed.
For example, for a person who waited for 2 hours 6 minutes, the amount to be reimbursed is Rs. 100, and also for 2 hours 40 minutes, Rs. 100 is to be returned
HINT: calculate the number of hours and then multiply the number of hours with 50.
What is the MAXimum number of swaps between heap elements required to construct a max heap of 9 elements using the O(n) BuildHeap(array)?
What is the MAXimum number of comparisons between heap elements required to construct a max heap of 12 elements using the O(n) BuildHeap(array)?
LATEST TUTORIALS
APPROVED BY CLIENTS