1. Create a class polynomial to create a linked list that uses class node from task 1 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
Write a class Battery that models a rechargeable battery.
Capacity: double
String company;
· having no parameter – for setting values to zero or null.
· having two parameters for assigning values to both data members.
· Overload the above constructor and use this keyword to set the values of data members
· Provide getters and setters for data member(s).
· The method public void drain (double amount) drains the capacity of the battery by the given amount.
· The method public void charge () charges the battery to its original capacity.
· A method toString to print object data.
1. Inside main, create 3 objects.
a. Set values of first object using constructor.
b. Take data from user and set the values for the 2 objects and display values.
2. Call all the above methods (drain, charge) and display updated values.
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.
Your task is to develop a circular linked-list based simulation of the Josephus problem. The
simulation will be text based. The user should be presented with a text-based menu asking him to
enter the total number of people (n), starting point (i), direction (clockwise/anti-clockwise) and
number to be skipped (k).
Let’s take an example.
• For n =15 (i.e. number of people is 15)
• k = 2 (i.e. every 2nd person is killed)
• starting point (i) = 1
• direction = clockwise
Initial scenario: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
After 1
st iteration: 1 3 5 7 9 11 13 15
After 2
nd iteration: 3 7 11 15
After 3rd iteration: 7 15
After 4th iteration: 15 (15 remains in the end). Program stops here.
SAMPLE RUN:
Class Participation
Quiz 1: 90
Quiz 2: 95
Quiz 3: 89
Quiz 4: 80
Average: 88.5
Lab. 1: 100
Lab. 2: 95
Lab. 3: 80
Lab 4: 70
Average: 86.25
Assignment 1: 100
Assignment 2: 80
Assignment 3: 89
Assignment 4: 75
Average: 86
Class Participation: 34.73
Prelim Exam: 95
%: 57.00
Prelim Grade: 91.73
Remarks: PASSED
You are creating a new, innovative machine for a company that you work for. The idea is new and
will give your company a real competitive advantage. The owner of the company wants to
copyright the machine that you are developing. You need to explain the following to the owner of
the company:
Q.4.1 Is copyright an appropriate form of intellectual property protection for a new
machine? Explain your answer.
(3)
Q.4.2 If not, what is the most appropriate form or intellectual property protection
for an innovative machine? Explain your answer.
(4)
Q.4.3 How is the most appropriate form of protection applied for? (2)
Q.4.4 How much protection will it provide? (4)
Q.4.5 Who owns the intellectual property relating to the machine?
1. The straight-line method for computing the yearly depreciation in value D for an item is given by the formula
D = P – S
Y
You are required to write a C++ program to assist Dr Plaatje with the running of her surgery. She
needs to know:
1) how many patients she has seen in the month.
2) the five (5) day in which she made most the money, (five highest earning days). If there are
more than one (1) days in which she made the same amount, just indicate that it was
duplicated on a particular day. Only note or record the last duplicate.
3) how much money she has collected in the month.
Also:
(a) Your program must run until the user stops it when the surgery closes at the end of the day,
when the report has to be generated.
(b) Assume a month has 31 days at most.
(c) Your program must ensure that input day is within the range [1..31]. It must not accept days
outside the range.
You are required to write a C++ program to assist Dr Plaatje with the running of her surgery. She needs to know: 1) how many patients she has seen in the month. 2) the five (5) day in which she made most the money, (five highest earning days). If there are more than one (1) days in which she made the same amount, just indicate that it was duplicated on a particular day. Only note or record the last duplicate. 3) how much money she has collected in the month. Also: (a) Your program must run until the user stops it when the surgery closes at the end of the day, when the report has to be generated. (b) Assume a month has 31 days at most. (c) Your program must ensure that input day is within the range [1..31]. It must not accept days outside the range.
#include<iostream>
#include<iomanip>
using namespace std;
char secretCode(int);
void printSequence(int);
int main(){
int number[10];
for (int index=0; index <10; index++){
cin >> number[index];
}
for (int index=0; index <10; index++){
cout <<secretCode( number[index]);
}
return 0;
}
char secretCode(int n){
char letters[] = "abcdefghijklmnopqrstuvwxyz";
int number=n;
while(number > 26){
number = number -26;
}
return letters[number-1];
}
Code above runs perfectly well,