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

Adjust the code you wrote for the last problem to allow for weighted classes. Add a parameter weighted (1 = yes, 0 = no) and then return the correct number for the GPA. Weighted classes get one extra point on the GPA value.

Input: Letter GradeExpected output: Non-weighted GPA valueExpected output: Weighted GPA valueA45B34C23D12F01Anything elseInvalidInvalid

Sample Run 1

Enter your Letter Grade: B
Is it weighted? (1 = yes, 0 = no) 1
Your GPA score is : 4

Sample Run 2

Enter your Letter Grade: B
Is it weighted? (1= yes, 0= no) 0
Your GPA score is: 3

Sample Run 3

Enter your Letter Grade: a
Is it weighted?(1 = yes, 0 = no) 0
Your GPA score is : 4

Templates and Exception Handling


Implement a Class Template Queue data structure for queue operations such as Full() and Empty() with exception handling. Note: Use templates with exception handling and size of queue is set to 5.

Print: "An queue overflow exception occurred!" or "An queue empty exception occurred!"


 Templates and Exception Handling


Design simple class BankAccount. If amount to be withdrawn is greater than balance, throw “Insufficient Balance” exception.


 Templates and Exception Handling


Design a template function for swapping the int, double and char type values between two variables. Note: Use function overloading.

run time input

10

35


In order to separate patients who are likely infected with the novel corona virus (COVID-19) from other patients, Fafagh clinic Records the temperature of all patients before triaging. According to a new policy of the clinic, the number of patients allowed should not exceed one hundred (100) in day. The policy also stipulates that a patient should be considered for a malaria test when his/her temperature is between 38 degree Celsius and 40 degree Celsius.whilst a patient whose temperature is above 40 degrees Celsius should undergo the Covid 19 test. Although the thermometer used to record the patient’s temperature is calibrated in Fahrenheit, the chart recommended by the policy for determining the test required (malaria/ Covid 19) is specified in Celsius.

1.Draw a flowchart for the above problem

2. Write a program in C++ programming language that:




Give an example of a "while" loop, then provide the equivalent "do-while" loop and "for" loop. Then give a different example of a do-while loop, along with the equivalent while loop and for loop. Finally, give an example of a for loop, along with the equivalent while loop and do-while loop. 


A teacher has asked all her students to line up according to to their first name. For example, in one class Amy will be at the front of the line and Yolanda will be at the end. Write program that reads the number of students and their names from a file. Once all the names have been read, it reports which student would be at the front of the line and which would be at the end of the line. 


Write a program that produces the following output using nested for loops.

****** ///////////// ******

***** ///////////\\ *****

**** /////////\\\\ ****

*** //////\\\\\\\ ***

** ////\\\\\\\\\ **

* //\\\\\\\\\\\ *

\\\\\\\\\\\\\ 


Write a program that reads a word and prints all sub strings sorted by length. For example, if the user enters the word ”cat”, the program prints

c

a

t

ca

at

cat


*Based on answer choices A-E, what is the code's output?


10. Given the following code, the output is __.


class Apple

{

int i;

Apple(int n) { i = n; }

}

class Sample

{

int j;

private Sample()

{

Apple a1 = new Apple(2);

a1.i++;

j = a1.i;

}

public static void main(String args[])

{

Sample s1 = new Sample();

System.out.println(s1.j);

}

}


A. 5

B. 4

C. 3

D. 2

E. 1


LATEST TUTORIALS
APPROVED BY CLIENTS