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 class student with following data members and methods.

Private:

1. stdID //A string that hold the ID of student

2. stdName //A string that hold the name of student

3. dept //A string that hold the department name of student

Public:

1. Default Constructor initialize all member variables with null value

2. Overloaded Constructor1 (stdID= 12345, stdName = Ali Hassan)

3. Overloaded Constructor2 (stdID= 23456, std, Name = Sheraz Depp, dept = Computer

Science)

4. Overloaded Constructor3 (stdName = Fahad abbas , dept = Computer Science)

5. inputData Input from user using this pointer for all members

6. displayData method that display data using this pointer

Now in main function create three objects (obj1, obj2, obj3) and each call different constructors.

Now create obj4 and initialize it with obj3 using copy constructor.

Now dynamically create 3 other objects and initialize them with any data of your choice. Show

your results on console.

 


Differentiate between the followings with the help of examples:

(a) Deterministic and Stochastic Algorithms

(b) Local and Global optima.


Make Employee an abstract class. Declare salary() and display() as pure virtual functions in it. Derive salaried employee (monthly), hourly employee (per hour basis), and commissioned employee (bonus on completing each target) from base class Employee. The display() function should show employee no, employee name, and salary of all employees. 



Create a class TV having the following attributes and functions.(C++)

1.      Volume (int)

2.      currentChannel (int)

Create another class called Remote Control having the following functions

1.      volumeUp()

2.      volumeDown()

3.      ChannelUp()

4.      ChannelDown()

Make the remote class friend of TV class.


You are requested to write a very simple calculator. Your calculator should be able to handle the five basic mathematic

operations – add, subtract, multiply, divide and modulus – on two input values.


Q1. Solve the following question to find best courses/payment using dynamic programming:

A graduate student may take any number of courses as a Teaching Assistant. There are five

courses and each associated with a payment. Each course has a number of hours needed and

the student is allowed to spend a maximum of 6 hours on TA duties. Find the best choice for

the grad student to maximize his/her income based on the following five courses specified as

(hours needed, payment received). -- (1,2, (4,5), (5,6) ), (2,3), (3,4)


Given a string, write a program to mirror the characters of the string in alphabetical order to create a secret message.


Note: Mirroring the characters in alphabetical order replacing the letters 'a' with 'z', 'b' with 'y', ... , 'z' with 'a'. You need to mirror both uppercase and lowercase characters. You can ignore mirroring for all characters that are not letters.


abcdefghijklmzyxwvutsrqpon nopqrstuvwxyzmlkjihgfedcbaInput


The input will be a string in the single line containing spaces and letters (both uppercase and lowercase).Output


The output should be a single line containing the secret message. All characters in the output should be in lower case.

Explanation

.

Sample Input 1

python

output

kbgslm

sample 2

Foundations

output

ulfmwzgrlmh




Given a string, write a program to print a secret message that replaces characters with numbers 'a' with 1, 'b' with 2, ..., 'z' with 26 where characters are separated by '-'.


Note: You need to replace both uppercase and lowercase characters. You can ignore replacing all characters that are not letters.


a b c d e f g h i j k l m n o p q r s t u v w x y z

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26


Input

Explanation


For example, if the given input is "python", "p" should replaced with "16", similarly"y" with "25","t" with "20","h" with "8","o" with "15","n" with "14". So the output should be "16-25-20-8-15-14".

  • Sample Input 1
python learning
  • Sample output:
16-25-20-8-15-14 12-5-1-18-14-9-14-7
  • sample input 2
python
  • sample output
16-25-20-8-15-14
  • sample input
Foundations
  • sample output
6-15-21-14-4-1-20-9-15-14-19

Perform the subnetting on the below IP Address and find out the number of networks, network of, first host, last host, and broadcast id of each network.

IP Address:103.204.177.0/30

In this python code there are three test cases. The three test cases are not coming expected output.

The three test cases are in below link

https://drive.google.com/file/d/1pcEniOexSN8TMkXxXU05FDKoPlYYbLCe/view?usp=sharing

sentence = "to be or not to be"
s = sentence.split()
s.sort()
result = []
for word1 in s:
    for word2 in s:
        result.append(word1 + " " + word2)
       
result = set(result)
result = list(result)
result.sort()


for item in result:
    if item in sentence:
        result.remove(item)
        
for item in result: 
    if " ".join(item.split()[::-1]) in sentence:
        result.remove(item)
        
for item in result:
    spl = item.split()
    if (spl[0] == spl[1]) and (sentence.count(spl[0]) < 2):
        result.remove(item)
        
for item in result:
    spl = item.split()
    dup = spl[1] + " " + spl[0]
    if dup in result:
        result.remove(dup)
result.insert(0, "be be")   
for item in result:
    print(item)
LATEST TUTORIALS
APPROVED BY CLIENTS