A toy company manufactures electronic learning boards for kids to learn alphabets. Accordingly,
when a kid presses 1 alphabet a is shown on the screen, and when 2 is pressed ab is shown along
with the previous alphabet and so on. The patterns are likely to be as follow:
a
ab
abc
abcd
abcde
:
:
:
:
abcdefghijklmnopqrstuvwxyz
Develop a C-script which generates the above-mentioned pattern.
Develop a program that asks user to enter a real number. After entering the numbers, the program
should display how many positive, negatives, and zeros were entered by the user. In addition to
that, it should provide information about the majority count either of the entered numbers.
Note : use any loop and avoid to use arrays .
You are tech-entrepreneur venturing into the field of Financial technology and is concerned about the lack financial savings culture among the youth. You have settled on an idea to come up with your own software that allows users to deposit cash for safe keeping and future planning. Whenever a user wants to withdraw money from their accounts, they can visit nearby cash ATM that your company has setup, and withdraw directly by first keying in usernames and passwords. They are also given the option of checking their balance and changing their password. In order to make cash deposits, you have settled on the role of an administrator who will be stationed near an ATM machine, and users will be approaching this administrator to help them make deposits to their accounts. The administrator will log in t using their admin usernames and passwords. They will then be given an option of making a cash deposit for normal users, create an account for new users and also be able to change their administrator passwords.
An applicant will be accepted to the Jedi Knight Academy if he is at least 200 cm
tall; age is between 21 and 25 inclusive, and a citizen of the Planet Endor.
However, if the applicant is recommendee of Jedi Master Obi Wan, he is accepted
automatically regardless of his height, age and citizenship. Write a program that
would input the applicant's height, age, citizenship code (1- citizen 0-not citizen)
and recommendee's code (1- recommended 0- not recommended) and then output
whether the applicant is accepted or rejected.
Q3: Write a complete Class called “Triangle”, which represents a mathematical
triangle. (10 points)
The structure has the following instance variables:
1. base – double value representing the base of a triangle
2. height – double value representing the height of the rectangle
The structure has the following methods
1. Constructor - This constructor takes two formal parameters representing the base and height respectively. The parameters are used to initialize the corresponding instance variables.
2. getBase - This method returns the base value.
3. getHeight - This method returns the height value.
4. setBase - This method updates the base value with the single parameter.
5. setHeight - This method updates the height value with the single parameter.
6. Area - This is a static method that takes as formal parameter a Triangle reference and returns a double representing the area of the triangle.
Q4: Create a Car class. Identify the attributes and functions of the class (with respect to driver and not engineer)
For Example:
Attribute: No. of Seats
Function: accelerate() or startCar()
What will the value of the answer variable be after the code segment below has been run.
int answer ;
int number1 = 285, number6 = 46, number11 = 1;
answer = ( number1 % number6 ) / number11;
The half-life of radium is 1600 years, i.e., it takes 1600 years for half of any quantity to decay. If a sample initially contains 50 g, how long will it be until it contains 45 g by power series method?Write a Matlab code for the above problem
Question 2a: Explain further on the three main principles of Object-Oriented Programming
Consider the following schedule of transactions
W1(A) W2(A) W1(A) W2(A) W1(A)
Which of the following properties are true for the above schedule and justify the reason for your answer
with explanation?
a) Conflict Serializable
b) View Serializable
c) Recoverable