Questions: 9 913

Answers by our Experts: 9 913

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

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.


F&W Sdn Bhd is a packaging company. Write a program in C++ to help the company  determines how many boxes that are needed for an item. For example, a box of shampoo can  have 30 bottles in it. So, 95 bottles of shampoo need to be packed into 3 boxes and 5 are left.  The number of each item and the number of an item that can be packed in a box are received  as inputs. Display the number of boxes needed and the number of leftover items. 




Write a program that prompts the user to input a string and outputs the string in uppercase letters. (Use a character


array to store the string.)



(Must be implemented using dynamic array)

// Use c++ language and must use Standard Library List ( STL ) in your program

Please write class for hash table using chaining and it must contain the following  functions:
  • Please insert an element in table
  • Please search an element in table
  • Please delete an element in table
  • Please return no of the chains currently present
  • Please display the hash table of the class
  • Please write the main function to test the class created.

// Must use Standard Library List ( STL ) in your program

Create the class Employee that has the following member data: employee id, employee name, gender, date of birth, address, contact number, date hired, employee type, position, and salary rate. Define all the accessors and mutators needed for the member data of this class. Test the class by creating an object in the main function and try changing or displaying the values of its member data through its accessors and mutators.


Write a program to overload operators in the same program by writing suitable operator member functions for following set of expressions:

O5= (O1/O2) *(O3+O4)

[Here O1,O2,O3,O4 and O5 are objects of a class “overloading”, and this class is having one integer data member]  


Write a program to overload operators in the same program by writing suitable operator member functions for the following set of expressions:


O5=(O1/O2)*(O3+O4)


(Here O1,O2,O3,O4 and O5 are objects of a class overloading and this class is having one integer data member

LATEST TUTORIALS
APPROVED BY CLIENTS