Code the following diagram Progression Class should be taken as abstract class,
think carefully before implementation. Correct Approach will give you maximum
marks.
Class progession
Fields:long first
Long cur
Methods:Progession()
Long firstvalue()
Long nextvalue()
Void print progession()
Inherited classes of progression :
1) class ArithProgression
Fields:long inc
Methods:ArithProgression()
ArithProgression(long)
Long nextvalue()
2) class GeomProgression
Fields:long base Methods:GeomProgression()
GeomProgression(long)
Long nextvalue()
3)class FibonacciProgression
Fields:long prev
Methods:FibonacciProgression()
FibonaciiProgression(long, long)
Long nextvalue()
To complete our program, we define the main function, which performs a simple
test of each of the two classes.
1) Define a class called student that has the following data members:
- int student number
- string student name
- double student average
The following member functions:
- Constructor that initialize the data members with default values.
- set and get functions for each data member
- Print function to print the values of data members.
Define a class called graduatestudent that inherits data members and functions
from the class student, and then declare the following data members :
- int level
- int year
Member functions:
- constructor
-set and get functions for each data member
- Print function.
Define a class called master that inherits data members and functions from
graduatestudent class, and then declare the following data member:
- int newid.
Member function:
- constructor
- set and get function for the data member
- Print function.
Write a driver program that:
- Declare object of type student with suitab le values then print it
accept the degrees of an angle .determine the type of angle and display it
Rearrange Numbers in String
Given a string, write a program to re-arrange all the numbers appearing in the string in decreasing order. Note: There will not be any negative numbers or numbers with decimal part.
def IsNum(s):
try:
int(s)
return True
except ValueError:
return False
s = input()
words = s.split()
numbers = []
for x in words:
if IsNum(x):
numbers.append(int(x))
if len(numbers) < 2:
print(s)
numbers.sort(reverse=True)
result = ''
for x in words:
if IsNum(x):
result += str(numbers[0])
numbers = numbers[1:]
else:
result += x
result += ' '
print(result[:-1])
but if we are giving "Narendra52 is 12 years and 5 months old" 52 also should be calculated as a separate number but it is not acting like thatn 1
(Marks: 40)
Sam runs a local musical equipment store in your neighbourhood. He has contracted you to create
an interactive application that will assist him with customer purchases. Create a class named
Customer Purchases that will contain get and set methods for a customer number, first name,
surname, product, price and quantity. Create a separate class called Printing that will include a
method called Print Details, that will print the Customer Invoice. In the Printing class include
another method called Customer Purchase Report which will display the following information:
REPORT OPTION
PERCENTAGE
TAX
15%
COMMISSION
8.5%
DISCOUNT
10%
TOTAL
(Price + Tax) – (Discount + Commission)
In your main class, capture all the customer purchase details required to produce the reports.
Sample Screenshot 1
Sample Screenshot 2
Sample Screenshot 3
© The Independent Institute of Education (Pty) Ltd 2021
HOW CAN I FORCE THE USER TO ENTER 26 DISTINCTIVE CAPITAL LETTERS IN C# pleaseee post solution
The link below is the photo of the problem. Please create a code without using def
Determine in order, post order and pre order
https://www.bartleby.com/questions-and-answers/52-37-64-24-39-59-73-19-29-56-in-order-pre-order-post-order/100dd94b-74dc-49e0-a700-97b1a7f6afbd
Determine the in-order, pre-order, and post-order sequence of the following: 2 7 5 2 6 9 5 11 4 30 (20 (39 10 25 35 (42 15 23
Write a C program that declares an array of structures of type ‘car’. and asks the user to fill in the elements. Once all the structures have been initialized, the program should present a menu to the user so that he can print a certain structure, or modify its elements.