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

Create an element structure and a list structure that can store a list of integer numbers. Create 4 functions to i) Create an empty list, ii) Add a number to begin of list, iii) Add a number to end of list, iv) Add a number to specific position in the list, and v) display list. Put all of these structures and functions into a header file named: yourName-SingleLinkList.h

Hint: Following are sample function prototypes:

List* createAnEmptyList( ) void addToBeginOfList(List *ls, int data)

void displayList(List *ls) void addToEndOfList(List *ls, int data)

void addSpecificPositionInList(List *ls, int data, int position)


Implement a class Matrix to create matrices of 2x2, 3x3 and 4x4 with the following private

datamembers:

1. int **matrix – a double pointer of type integer to create a 2D array (matrix)

2. int row – an integer to store the rows in the matrix

3. int col – an integer to store the columns in the matrix

The class shall have the following public member functions:

1. Matrix Add(Matrix m) – adds the calling object matrix with the one passed as an argument and returns a resultant matrix

2. Matrix Subtract(Matrix m) – subtracts the calling object matrix with the one passed as an argument and returns a resultant matrix

3. Matrix Multiply(Matrix m) – multiplies the calling object matrix with the one passed as an argument and returns a resultant matrix

4. int FindkSmallest(int k) – a function that finds the kth smallest element in the matrix. If k is 1, return the smallest element. If k is 2 return the second smallest element and so on.

5. Matrix merge(Matrix m) - a function to merge two matrices.


(using dev c++) Create a program that has class definitions for Item, Customer and Sales. The main simply


creates object object of each class and test its member functions. Modify the main program such that it


provides a menu driven interface where user can create objects of Item, Customer and a complete a


sales transaction with the sales object. The program should also have an option for display the records of


items, customers and sales. To make your program more useful, include file handling such that when


objects are created for Items, Customers and Transaction, the user will be prompted to save the record


on the file or not.

USING POLYMORPHISM

-Create a complex program that applies control structure, iterative, array . 



A triangular number is defined as m(m + 1)/2 for m = 1, 2, …, and so on. Therefore, the first few numbers are 1, 3, 6, 10, … . Write a function with the following header that returns a triangular number:

int getTriangularNumber (int n)

Write a test program that uses this function to display the first 75 triangular numbers with 5 numbers on each line.



create two variables: one containing the uppercase character 'G' and the other with uppercase letter 'O'. You can name the variable anything you want as long as it's a valid name that accepted in C.


Input a random positive integer. Then, create an integer array with a size the same as the inputted integer.


Then, using loops, add random integer values into the array one by one. The number of values to be stored is dependent on the inputted odd integer on the first instruction.


Print out the list's new order in this manner, with each number separated by a space per row:


second-half values


middle value


first-half values


Refer to the sample output for a clearer view on how it is to be printed out.

Input a random positive integer, n.



Create an empty character array with a size of the inputted random positive integer, n.



In the next succeeding lines, store the n characters into the character array.



Input an integer, m, for an index. This value should be from 0 to n - 1.



Using your understanding on accessing array elements, access and print out the array element having the index position of the inputted random integer, m.

An array containing 10 predefined double values are already provided for you in the code editor. Print each of the element out in separate lines, starting from the last array element down to the first.



Each outputted value must also only show up to two decimal places.

1. Create a C++ program to accept two integers and check if it is greater than or equal to 20. 


2. Build a C++ program to read the temperature in centigrade and display a suitable message according to the temperature state below: (nested-if else/switch case)

Temp < 0 then Freezing weather

Temp 0-10 then Very Cold weather

Temp 10-20 then Cold weather

Temp 20-30 then Normal in Temp

Temp 30-40 then it is Hot 

Temp >=40 then it is Very Hot

Example input: 42

Expected Output:

It is very hot.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS