C++ Answers

Questions answered by 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

ProblemStatement1

WriteaprograminC++thatcreates thefollowingfunctions:

 

Function

Description

 

Receivesstringobjectandreturnsnumberofvowelsinit.

 

Receivesstringobjectandreturnsnumberofconsonants

init.

 

Receivesstringobjectandreturnsnumberofuppercase

lettersinit.

 

Receivesstringobjectandreturnsnumberoflowercase

lettersinit.

 

Useallofthefunctions inmainfunction.


Using while or do-while. The Area of a Circle = pi *(r*r). Where pi=3.1415 and r=Radius, Make a program that will input Radius and compute and display the Area. Your program will be terminated if input zero in the radius.


Write a C++ program that takes two integer numbers from user as

input, and display their sum.


Define username and password as array variables

In the program, set an initial value for the variables

  • Username: default
  • Password: admin

The user should be able to login using the default credentials

The program should be able to change the default values of the array

If the user tries to login using wrong credentials he will be asked to re-login but after 3 wrong attempts the program will display "You've exceeded the allowable number of tries! Try again later"

If the user successfully logged in, the message "Welcome to my World" should be displayed on screen

if this can done in a user-define function, it would be better but not required for now.


SCREEN LAYOUT / DESIGN

Username: default

Password: admin


Change Username and Password

[Y/N]: Y


(Input new value for UN and PW.)

Username: correct UN

Password: correct PW


Welcome to my World


(If wrong credentials)


Username: wrong UN

Password: wrong PW

(for the 3rd time)


You've exceeded the allowable number of tries! Try again later

Task 2.

Create a class Node with

a.      attributes data, next and previous pointer

b.      accessors and mutators for this class

c.      constructor and destructor

d.     function called display.

Using the node from task 2, implement a class called DLL with following functionalities

1.      insert a node at first ,

2.      overload to Insert a node at last

3.      overload to Insert at specified position of double linked list. E.g if the position number is 6, it is inserted between node at position 5 and 7. If position number is greater than the size of list, it is prompted that the position number does not exist and therefore is being inserted at end.


1.      Create a class Node with

a.      attributes data and next pointer

b.      accessors and mutators

c.      constructor and destructor

d.     function called display

e.      search node returning true or false

f.       overload the function search to include lookAhead method.

1.      Create a class polynomial to create a linked list that uses class node with the following functionalities

a.      Insertion. This function takes as an input the size of polynomial. E.g if the size is 6, the polynomial equation is of degree 6. Then you are required to create the appropriate list.

6x6+ 12x3+5

b.      Deletion. This function deletes the list of the degree of number passed as a parameter. E.g if the number is 7, it is invalid. If it is 2, it deletes the first 2 degrees and the remaining list is 12x3+5

c.      Overload the function of deletion. This function deletes the entire list.

d.      Traversal

e.      Print equation in the following format

6x6+0x5+0x4+ 12x3+0x2+0x1+5.


suppose we have top teams they are like that with their points

pakistan=99

india=52

bangladesh=80

Nz=72

sl=45

wi=84

now we have to find the top 3 teams



How can I get a program like this using Function Overloading in c++?


Example 1:

Enter

A - for comparing integers

B - for comparing float

C - for comparing characters

D - for comparing strings

Enter your choice: a

Enter two integers: 5 10

10 is greater


Example2:

Enter

A - for comparing integers

B - for comparing float

C - for comparing characters

D - for comparing strings

Enter your choice: d

Enter two integers: hello Hi

hello is greater



Write a program that calculates the average number of days a company’s employees are absent. The program  should have the following functions: 

- A function called by main that asks the user for the number of employees in the company. This value should be  returned as an int. 

- A function called by main that accepts one argument: the number of employees in the company. The function  should ask the user to enter the number of days each employee missed during the past year. The total of these  days should be returned as an int. 

- A function called by main that takes two arguments: the number of employees in the company and the total  number of days absent for all employees during the year. The function should return, as a double, the average  number of days absent. 


Input Validation: Do not accept a number less than 1 for number of employees. Do not accept a negative  number for the days any employee missed. 




The Area of a Circle = pi (rr). Where pi=3.1415 and r=Radius, Make a program that will input Radius and compute and display the Area. Your program will be terminated if input zero in the radius.

LATEST TUTORIALS
APPROVED BY CLIENTS