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 Program: Print a table of stars and zeroes

print a square table of alternating stars and zeroes.


Ask the user to enter a size of the table. The number should be odd. Since the table is square the number of rows and columns will be the same and should be equal to the entered size. The valid range for the size is from 3 to 15, inclusive.


Use a loop to make sure the entered size is odd and within the range. Output a descriptive error message if an invalid size is entered. The error message should indicate if the size is even, or less than the minimum, or larger than the maximum.


If more than one error condition appears. Don't create separate output strings for all combinations of error conditions


Each row in said table should have ‘*’ and ‘0’ symbols separated by a space. Each column of the table should also have alternating ‘*’ and ‘0’ symbols. All corners should have the ‘*’ symbol.





Write a program to create a class called STUDENT with data members Roll

Number, Name and Age. Using inheritance, create the classes

UGSTUDENT and PGSTUDENT having fields a semester, fees and

stipend. Enter the data for at least 5 students. Find the average age for all

UG and PG students separately.


(Multipath Inheritance) Design a base class called Student with two

fields:- (i) Name (ii) roll number. Derive two classes called Sports and

Exam from the Student base class. Class Sports has a field called s_grade

and class Exam has a field called e_grade which are integer fields. Derive a

class called Results which inherit from Sports and Exam. This class has a

character array or string field to represent the final result. Also it has a

member function called display which can be be used to display the final result.Illustrate the usage of these classes in main.


Can you share an example of a simple looping application?

  • It can be a simple C++ code applying any of the 3 looping statements OR
  • An animated image / video doing repetitive activities; 
LAB TASK (STACK) 1)
1)Perform the Stack Program using Array.
2) Array Size is 2999. And Array name is BSCS Stack
3) All Variable Names will be changed.
4) Create Function after main body.


  • There are several data types in C++ namely built-in data types and enumerated datatypes and class types. Now you have to write a C++ program that reads the file compiled using C++ compiler successfully. The output of the file must display in tabular column the name of the data type and how many times it is used in program. that means how many integers are declared, how many classes declared and instantiated etc.




1. Write a program to find words in an English text and store them in the Binary Search Tree in alphabetical order. Comparison is to be done with respect to the words in the text. When the same word appears, a count of number of occurrences needs to be maintained. Finally, print() function is used to print all words in alphabetical order along with their count, that denotes the number of occurrences.



Note: a) Use strcmp() function .
b) Assume that only words are to be considered from the text without any punctuation marks.
c) Assume that the input text is given in the main function.

You are a freelance calendar maker. Unfortunately, like me, you are useless are remembering how many days there are in each month of the year.


Write a program that uses a switch statement to tell a user how many days there are in a month.


Your cases should test a number corresponding to the months (e.g. 1 = January, 12 = December), and true cases should print out how many days there are in a month.




Create a class called bMoney. It should store money amounts as long doubles. Use the
function mstold() to convert a money string entered as input into a long double, and
the function ldtoms() to convert the long double to a money string for display. (See
Exercises 6 and 10.) You can call the input and output member functions getmoney()
and putmoney(). Write another member function that adds two bMoney amounts; you can
call it madd(). Adding bMoney objects is easy: Just add the long double member data
amounts in two bMoney objects. Write a main() program that repeatedly asks the user to
enter two money strings, and then displays the sum as a money string. Here’s how the
class specifier might look:
class bMoney
{
private:
long double money;
public:
bMoney();
bMoney(char s[]);
void madd(bMoney m1, bMoney m2);
void getmoney();
void putmoney();
};
Start with a program that allows the user to input a number of integers, and then stores
them in an int array. Write a function called maxint() that goes through the array,
element by element, looking for the largest one. The function should take as arguments
the address of the array and the number of elements in it, and return the index number of
the largest element. The program should call this function and then display the largest
element and its index number.
LATEST TUTORIALS
APPROVED BY CLIENTS