Given this list of students containing age and name, students = [{"age": 19, "name": "Eunice"}, {"age": 21, "name": "Agnes"}, {"age": 18, "name": "Teresa"}, {"age": 22, "name": "Asha"}], write a function that greets each student and tells them the year they were born. e.g Hello Eunice, you were born in the year 2002.
Create a Class Rectangle with the following Attributes and Methods
Attributes: The class has attributes width and length that represent the two sides of a rectangle
Methods:
Add a method named area which returns the area (A) of the rectangle using the formula A=width*length
Add a method named perimeter which returns the perimeter (P) of the rectangle using the formula P=2(length+width)
Read about doing multiplication using Karatsuba method
(https://en.wikipedia.org/wiki/Karatsuba_algorithm ).
Write a C++ program which:
• Prompts user to enter two large integer numbers (x, y).
• Make a function called Karatsuba() which takes these two integers and returns the
multiplication result using Karatsuba algorithm.
o Your function should do parameter validation. Both numbers must be more
than 4 digits and less than 10 digits (don’t use strings). If parameters are not
valid then the function should return 0;
o The entered numbers could be negative or positive. For example: 820778 and
-58712979 where x is 6-digit positive number and y is 8-digit negative
number.
• You might need to make another helper function called getDigits() which will get an
integer as input and returns number of digits of that integer. getDigits() will help you
find the value of m and Bm.
• Finally, display result in the main function
Create a class: Person with member variables: name and age. Create two overloaded
constructors for this class along with a copy constructor. Also create a destructor. Include
member function, get_data(), to get the name and age of the person. Define a member function,
display_data() to display the member variables. Define objects for this class and showcase the
Create a class named 'Rectangle' with two data members 'length' and 'breadth' and two methods to print the area. Then create a class named ‘Square’ with data member radius and method to print the area. Print the area of a rectangle and a square with Uses A relationship by creating another class Shape_of_rectangle.
by CodeChum Admin
Looping a number and taking away each digit of it is so much fun, but I wanted to try out a much more complex task: getting the largest digit among them all.
Think you can handle the job?
Instructions:
Input
A line containing an integer.
214
Output
A line containing an integer.
4
by CodeChum Admin
Manipulating values from a series of numbers is fun, but let's try exploring the use of loops a little more.
How about printing out each digit of a number starting from its rightmost digit, going to its leftmost digit?
Instructions:
Input
A line containing an integer.
214
Output
Multiple lines containing an integer.
4
1
2
list 20 types of motherboard ,draw and label one?
Write a program that will determine the best Second year student.
Create a front-end class SecondYears that will determine the best first year student.
The class has the following data members:
-an array of ten student objects named myStudents.
The class has the following methods
-enterStudentValues that prompts and reads the values that the each student has to be set to, and sets it accordingly.
-sortStudents that will sort the Students object in descending sequence of the overall average.
-Display that will display all the students in the array.
when you run it must show these:
Write a main() program that:
-Instantiates a SecondYears object
-Read in values into the SecondYears object students array using its enterStudentValues method.
-Display all the students using the objects display method.
-Sort the students in descending sequence of their overall average.
-Display again to show the best student.
Writing a program that will determine the best Second year student.
Write the class definition for a Student class that contains four private data members:
-An int studNum to store the student number.
-A string studFirstName to store the student’s first name.
-A string studSurname to store the student’s surname.
-A one dimensional array subjectCode of type string that hold the five subjects that the student is registered for.
-A parallel array to the subject code array called finalMark that holds the final mark that the student obtained for the subject stored in the subject code array.
-A double overallAverage that will hold the overall average that the student has obtained
The class has the following methods:
-A default constructor that sets the data members to appropriate default values for all data members, including the arrays.
-A setStudent method that receives parameters for the student number and name, as well as an array of type string and an array of type double for the subjects code and final mark respectively.