Questions: 11 404

Free Answers by our Experts: 10 612

Many students face the C++ problems and have no idea how to cope with them. They start worrying about their results and feel miserable because of that. We don’t want you to be sad because of your C++ problems and want provide you with the C++ answers you are looking for. We know how many C++ questions are there in your head and we also know how important it is for you to get good marks. Let our service to look for the C++ answers for all your questions and make you sure that home assignment may be not that bad as you may think!

Ask Your question

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

An election is contested by five candidates. The candidates are numbered 1 to 5 and a voting is done by marking the candidate number in a ballot paper. Write a C++ program to read the ballot and count the votes cast for each candidate using an array variable count. In case, a number read is outside the range 1 to 5 the ballot should be considered as a 'spoilt ballot', and the program should also count the number of spoilt ballots

An election is contested by five candidates. The candidates are numbered 1 to 5 and a voting is done by marking the candidate number in a ballot paper. Write a C++ program to read the ballot and count the votes cast for each candidate using an array variable count. In case, a number read is outside the range 1 to 5 the ballot should be considered as a 'spoilt ballot', and the program should also count the number of spoilt ballots

You are required to demonstrate the running time difference between a linked list and a binary search tree while searching the data. Read the following instructions and then implement a C++ program that can address the above requirement.



1-     With this word file you will be provided with a .csv file containing the data named "Dataset". The dataset file contains a record of 100000 sales records of a store.


2-     By using the text file reading method in C++, read the data of the file in a linked list and a binary search tree. (In a single program)


3-     After reading the data validate the data reading by implementing a print() method.


4-     Take a sales id as an input from the user and search that ID in the linked list and binary search tree.


5-     Display the running time difference of both data structures during the search operation.


6-     For running time calculation you can use Chrono library. You can find a good tutorial on Chrono library on the link:

Write a program that dynamically allocates an array large enough to hold a user-defined number of test



scores. Once all the scores are entered, the array should be passed to a function that sorts them in



ascending order. Another function should be called that calculates the average score. The program



should display the sorted list of scores and averages with appropriate headings. Use pointer notation



rather than array notation whenever possible.



Input Validation: Do not accept negative numbers for test scores.



Example



Enter the number of test scores: 4



Enter each test score:



Test#1: 34



Test #2: 73



Test #3: 22



Test #4: 89



Sorted test scores:



Test #1: 22



Test #2: 34



Test #3: 73



Test #4: 89



Average = 54.5

A 1D binary character array is given to you in file “task1.txt”. You are required to find out maximum



consecutive ones in the array.



Note: Read the file and find the exact length of data in a separate function. Use that size to create a



dynamic integer array using pointers. Then, read the file again and insert data into this dynamic array of



exact calculated size. Then You are required to find out maximum consecutive ones in the array.



task1.txt



11010101111110110111010



Expected output:



- maximum consecutive ones are: 111111



- Starting index is: 7



- Length is: 6




Write a C++ program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should have the following functions:



void getScore() should read a score from the file and store it in reference parameter variable. This function should be called by main once for each of the five scores to be entered.


void calcAverage() should calculate and display the average of the four highest scores. This function should be called just once by main, and should be passed the five scores.


int findLowest() should find and return the lowest of the five scores passed to it. It should be called by calcAverage, which uses the function to determine which of the five scores to drop.

You are required to demonstrate the running time difference between a linked list

and a binary search tree while searching the data. Read the following instructions

and then implement a C++ program that can address the above requirement.

1-   choose a file by self the dataset file contains a record of 100000 sales records of a

store.

2-   By using the text file reading method in C++, read the data of the file in a

linked list and a binary search tree. (In a single program)

3-   After reading the data validate the data reading by implementing a print()

method.

4-   Take a sales id as an input from the user and search that ID in the linked list

and binary search tree.

5-   Display the running time difference of both data structures during the search

operation.


10. Consider a two-dimensional array Marks[10][5] having its base address as 2000 and the




number of




bytes per element of the array is 2. Now, compute the address of the element, Marks[8][5],




assuming that the elements are stored in row major order.

Take a real-world scenario of inheritance and implement it in C++ program. Your program should consist of the following: 

1. Use Constructors and appropriate access modifier 2. List and draw Base class and Derived class 3. Show polymorphism (function overriding and function overloading) 4. Multiple inheritance 5. Put the user’s data into a file and display a data from a file to the user. 

6. Implement Abstract class and interface


Write a C++ program that calculates the nth power of numbers from 1 to k. where n

and k will be input by user.

Expected Output:

Input Power value , n: 3

Input k : 5

3rd power of 1 is 1

3rd power of 2 is 8

3rd power of 3 is 27

3rd power of 4 is 64

3rd power of 5 is 125


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS