Questions: 11 448

Answers by our Experts: 10 707

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 C++ program that reads the number of sales (as integer values) at the end of each month for the ABC Supermarket of 5 departments (grocery, bakery, meat, vegetables, and electronics). The program reads all data from the input file sales.txt. The first line has an integer value N that represents the number of months to be processed. The following N input lines contain the name of the month followed by the sales of each department in that month (5 integer values).

Your program shall produce a nice report in a file report.txt showing the list of months and the sum of 5 sales for that month. The program will also output the total sum of all sales and the average sales per month. Format your output to produce an exact result as in the sample below. To output the # use setw(3), to output the month name use setw(6) and use setw(12) to output the sum of sales for the month. The final output should be limited to 2 decimal places.


Write a base class Computer that contains data members of wordsize(in bits),



memorysize (in megabytes), storagesize (in megabytes) and speed (in megahertz).



Derive a Laptop class that is a kind of computer but also specifies the object’s length,



width, height, and weight. Member functions for both classes should include a default



constructor, a constructor to inialize all components and a function to display data



members.

Write a class Person that has attributes of id, name and address. It has a constructor to


initialize, a member function to input and a member function to display data members.


Create another class Student that inherits Person class. It has additional attributes of


rollnumber and marks. It also has member function to input and display its data


members.

Write a program having a base class Student with data members rollno, name and


Class define a member functions getdata() to input values and another function


putdata() to display all values. A class Test is derived from class Student with data


members T1marks, T2marks, T3marks, Sessional1, Sessional2, Assignment and Final.


Also make a function getmarks() to enter marks for all variables except Final and also


make a function putmarks() to display result. Make a function Finalresult() to


calculate value for final variable using other marks. Then display the student result


along with student data.

write a program executing a loop,which is readinginteger numbers from the keyboard until at least one of the below listed conditions is fulfilled

1.the multiplication of these numbers exceeds 1000

2.the number of reported even numbers exceeds 10

3.three subsequent numbers will have exactly the same value (eg 3,4,2,5,5,5)


char secretCode(int n){

    char letters[ ]= "abcdefghijklmnopqrstuvwxyz";

int number = n;

while (number >26){

number = number - 26;

}

return letters[number-1];

}



The code above runs perfectly well, 


1. what would be the return value if the argument value for parameter n is 243?


2. what would be the return value if the argument value for parameter n is 123?


3. what would be the return value if the argument value for parameter n is 12456?


4. what would be the return value if the argument value for parameter n is 345?


5. what would be the return value if the argument value for parameter n is 354?


6. what would be the return value if the argument value for parameter n is 456?



a. Partially True

b. Absolute True

c. Partially False

d. Obviously False


Choose the appropriate one from the options above.


1. Float arr[ ] = {123.43}; is a valid array declaration and initialization.


2. Char arr [ ] = "123.43"; is a valid array declaration and initialization.


3. bool arr [ ] = {TRUE, TRUE, FALSE}; is a valid array declaration and initialization.


4. Char arr [ ] = "123.43"; is a valid array declaration and initialization.


5. double arr [ ] = {123.43}; is a valid array declaration and initialization.


6. char arr[30] = "123.43"; is a valid array declaration and initialization.


7. float arr [5] ={43, 23.23 ,423 ,123.43 ,876, 23}; is a valid array declaration and initialization.


8. double arr [ ] = [123.43]; is a valid array declaration and initialization.


9. Float arr [ ] = {123.43}; is a valid array declaration and initialization.


a. Partially True

b. Absolute True

c. Partially False

d. Obviously False

Choose the appropriate one from the options above.


1. bool arr[ ] ={false, ture, 0}; is a calid array declaration and initialization.


2. float arr[6] = {43, 23.23 ,423 ,123.43 ,876,23}; is a valid array declaration and initialization.


3. int arr[55] = {1, 2, 3, 4123.34, 123.43, 876, 23}; is a valid array declaration and initialization.


4. int arr[2] = {1, 2, 3, 4123.34, 123.43, 876, 23}; is a valid array declaration and initialization.


5. float arr[20] = {43, 23.23 ,423 ,123.43 ,876, 23}; is a valid array declaration and initialization.


6. bool truth_table[ ] ={true}; is a valid array declaration and initialization.


7. int arr[ ] = {1, 2, 3, 4123.34, 123.43, 876, 23}; is a valid array declaration and initialization.





The cost of a brand new car is P420,000 for GL model and P398,000 for XL model. If a car



phone will be installed, an additional P40,000 will be added to the cost. Moreover, a 15%



discount on the total cost will be given if the buyer pays in full (not installment).



Write a program that would input the car model bought whether with car phone (use code



"W" for car with car phone and "O" for without car phone) and whether it will be paid in full (use



code "F" for full payment and "I" for installment). Program must then output the net cost of the



car.

In order to discourage excess electric consumption, an electrical company charges its customers a lower rate of P75 for the first 250 kilowatt-hours and a higher rate of P85 for each additional kilowatt-hour. In addition, a 10% surtax is added to the final bill. Write a program that calculates the electrical bill given the number of kilowatt-hours consumed as input. At the end, print the number of kilowatt-hours consumed and the computed bill.


LATEST TUTORIALS
APPROVED BY CLIENTS