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

You are required to implement a shopping cart module for an online shopping mall. From the available

items a user will select the item to purchase and add this into his shopping cart. Before the checkout

customer can remove any item from the cart at any time.

A single item in the cart contains the following details:

class Item

{

private:

int itemID;

string itemName;

double price;

double purchasedQuantity;

double totalPrice;

public:

//constructors and getter setters

};

For the implementation of the required module you have to meet the following requirements:

1- Customer can add any item to the cart in desired quantity.

Remember if customer added the same item in the cart again, your implementation will not add

this as a new item it will check if the item already exists than it will just add the new quantity in

the previous and update other data.


Create a program that uses an array of structures of a user-defined type named student_record as shown in the declaration below.



struct student_record{


unsigned long id;


char name[20];


char subject[20];


double mt_grade;


double ft_grade;


double final_rating;


char remarks[20];


};


2. The program should ask how many student records to input (at least 4 records but not more than 20) and allow the user to input as many records of students as specified by the user except for the final rating and remarks. The values for the final rating and remarks should be based on the formula or conditions given below


final_rating = 40%mt_grade +50%ft_grade


remarks


EXCELLENT if the final_rating >=95%


VERY GOOD if the final_rating is between 85% and 94%


GOOD if final_rating is between 75% and 84%


NEEDS IMPROVEMENT if final_rating is below 75%


Display all the records with the computed final rating and remarks in a tabular format

class Matrix {2x2, 3x3 and 4x4 }private data members:

1. int **matrix

2. int row

3. int col

class public member functions:

1. Matrix (int n1, int n2, int n3, int n4, int row = 2, int col = 2)

2. Matrix (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int row = 3,

int col = 3)

3. Matrix (int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int n9, int n10, int

n11, int n12, int n13, int n14, int n15, int n16, int row = 4, int col = 4)

4. Matrix(const Matrix &m)

5. ~Matrix()

6. int getRow()

7. int getCol()

8. int getValue(int row, int col)

9. void setValue(int row, int col, int value)

10. int Total()

11. double Average()

12. int RowTotal(int row)

13. int ColumnTotal(int col)

14. int HighestInRow(int row)

15. int LowestInRow(int row)

16. Matrix Transpose()

17. int LeftDiagonalTotal()

18. int RightDiagonalTotal()

19. Matrix Add(Matrix m)

20. Matrix Subtract(Matrix m)

21. Matrix Multiply(Matrix m)

22. int FindkSmallest(int k)

23. int FindkLargest(int k)



Implement a class Sequence to store a sequence of non-negative integer values, and the length of the sequence. The class has the following private data members:

1. int length

2. int *pseq

The class shall provide the following public methods:

1. Sequence() – default constructor

2. Sequence(int lengthVal, int n1=0,int n2=0,int n3=0, int n4=0, int n5=0, int n6=0, int n7=0, int n8=0, int n9=0, int n10=0) – parameterized constructor should initialize the

length and array to sequence values passed in the arguments.

3. Sequence(Sequence &s)

4. int getLength()

5. int* getSeq()

6. void Sort(int n)

7. int RemoveDuplicates()

Return n after placing the final result in the first k elements of the array.

8. void Rotate(int steps) – a method that rotates the sequence elements clockwise for the

given steps

9. ~Sequence()


Azeem Telco Sdn. Bhd charges file, contains records for each call made by its subscribers during a month. Each record on a file contains the subscriber’s name and phone number, the phone number called, the distance from Shah Alam of the number called (in kilometers) and duration of the call-in seconds.

As a junior programmer, you are required to design and write a complete C++ program that asked the user to enter subscriber’s name and phone number, the phone number called, the distance from Shah Alam of the number called (in kilometers) and duration of the call-in seconds. The user also needs to enter types of call either Local or International call.

The cost of each call is calculated based on Table 1.

 Distance from Shah Alam

Less than 25 km

25 <=km<75

75 <=km<300

300 <= km <=1000 Greater than 1000 km

Cost(RM)/minute

Local International 0.35 0.55 0.65 0.85 1.00 1.20 2.00 2.20 3.00 3.20

          Your program should use the following:

1. Appropriate Control Structure

2 User Defined Function



Write a program that defines the named constant PI, const double PI = 3.14159;, which stores the value of π. The program should use PI and the functions listed in Table 6-1 to accomplish the following:

  • Output the value of √π .
  • Prompt the user to input the value of a double variable r, which stores the radius of a sphere. The program then outputs the following:
  • The value of 4.0πr², which is the surface area of the sphere.
  • The value of (4.0/3.0)πr³, which is the volume of the sphere.

A(n) ___ function doesn't return a value.


Layered

Int

Prototype

Void


Two of the main reasons for using functions are "divide and conquer" and "code reuse."


True

False


Function prototypes are placed below main(), while function definitions are placed above main()


True

False


A function prototype looks similar to the function ___, except there is a semicolon at the end.


Arguments

Body

Call

Header


LATEST TUTORIALS
APPROVED BY CLIENTS