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 & Filtering

Write a program using copy constructor to copy data of an object to another
object.
Write a Java program to display the three highest monthly speeding fines recorded for four
different cities. The following rows and columns represent the monthly speeding fines of each
city.
JAN FEB MAR
JHB 128km 135km 139km
DBN 155km 129km 175km
CTN 129km 130km 185km
PE 195km 155km 221km
Using a Two Dimensional array, produce the speeding fines report including the speeding fines
statistics. The speeding fines statistics must display the highest and lowest speeding fines in the
two dimensional array.
#include <string>
using namespace std;
struct book
{
string title;
string author;
unsigned int year;
};
int main()
{
book bookrec;
cout << “Enter Book Title:”; getline(cin,bookrec.title);
cout << “Enter Book Author:”; getline(cin,bookrec.author);
cout << “Enter Publication Year:”; cin >> bookrec.year;
cout << “The following information has been received…\n”);
cout << “Book Title:” << bookrec.title;
cout << “Book Author:” << bookrec.author;
cout << “Year Published:” << bookrec.year << “\n”;
system(“pause”);
return 0;
}


Modify Program Sample-1 by applying a structure array in the program. The program should accept 5 records of books and displays them on the screen.
The program should also include two functions: (1) a function for entering book information; and (2) a function for displaying the records.
Write a Java program to display three monthly sales of different vehicle types. The rows and
columns represent the monthly sales of each vehicle type.
JAN FEB MAR
SUV 25 15 35
COUPE 25 55 35
SEDAN 11 20 45
VAN 17 27 25
Using a Two-Dimensional array, produce the vehicle type sales report and the total sales made for
each vehicle type. If the total sales made per month are greater than or equal to 100, gold status
is awarded. If the monthly sales are less than 100, silver status is awarded.
for i in displayList:
    print(i[0])
    #loop through displayList
    for i in range(0,len(displayList)):
        #Test if the fist item in the current sub-list contains the text "Price Level
        #Tip: Remeber that each sub-list is a (displayList). So you have
        #       to access its items via displayList followed by TWO indexes.
        ......
            #Extract the second item from the currnet sub-list into variable called priceLevel
        priceLevel = ...
        #Test if priceLevel is between previousPrice and currentPrice OR
        #        priceLevel == previousPrice OR
        #        priceLevel == currentPrice
        if....

        :
            #Sound the alarm. Pass in the frequency and duration.
            if self.__currentPrice > self.__previousPrice:
                frequency = 800
                duration = 700
            else:
                frequency = 400
                duration = 700
            winsound.Beep(frequency, duration)

            #Print the text 'Alarm' with a green background color, so that the user
            #can go back and check when the alarm was sounded.
            ...





Design a console application that will print the final result obtained by a student with the weighting of
each module. Make use of an abstract class named Student that contains variables to store the
student number, test result, assignment result and exam. Create a constructor that accepts the
student number, test result, assignment result and the exam result as parameters and create get
methods for the variables. The Student class must implement an iReport interface that contains the
following:
public interface iReport {
public void print_report();
}
Create a subclass called Student_Report that extends the Student class. The Student_Report class
must contain a constructor to accept the student number, test, assignment and exam results as
parameters. Write code for the print_report method which calculates each assessment weighting as
follows:
Assessment Weighting
Test 25%
Assignment 25%
Exam 50%
Finally write a useStudent class to instantiate the Student_Report class
Write a Java program that will create a report to display the top three mobile device sales per month
from January to March 2018. The rows and columns represent the monthly sales of each device.
JAN FEB MAR TOTAL
IPhone 7 30 15 35 80
Samsung S8 20 25 30 75
Huawei Mate 10 25 11 32 68
MONTHLY TOTAL 75 51 97
Using a Two-Dimensional array, produce the monthly mobile device sales report and the total sales
for each device.

a.      Describe the concept of a Binary heap and the heap order property. [10 marks]

b.     Explain the use of the binary heap as an effective implementation for a priority queue [10 MARKS]


Simulate the fragment of codes below and trace the output. 


int *p1, *p2;

p1 = new int;

p2 = new int;

*p1 = 10;

*p2 = 20;

cout << *p1 << “ ” << *p2 << endl;

p1 = p2;

cout << *p1 << “ ” << *p2 << endl;

*p2 = 30;

cout << *p1 << “ ” << *p2 << endl;


Write a program that will prompt the user to input the following:

 

1. The number of dice to be rolled.

2. How many times the dice should be rolled?

Since the values above will vary, you must use pointer arrays and dynamically allocate memory.

The program will store the total of faces per roll and the values will be later used to plot a graph. The graph should look like the output shown below

3:

4:

5:

6:

7:

8: *

9:

10:

11:

12: *

13:

14:

15:

16:

17:

18:

 

The asterisk (*) tallies the number of times that total has occurred. 3 and 18 are the minimum and maximum totals, respectively, for rolling 3 dice.

The declaration and implementation sections of the class have been defined for you. Use it to complete your program.




LATEST TUTORIALS
APPROVED BY CLIENTS