Critically analyse the difference between horizontal application software and vertical application
software.
Program in Java
PROGRAM DESIGN
Create a class Date that can perform the following operations on a date:
- Set/Return the Month
- Set/Return the Day
- Set/Return the Year
- Whether the year is a leap year.
if the year number isn't divisible by 4, it is a common year;
otherwise, if the year number isn't divisible by 100, it is a leap year;
otherwise, if the year number isn't divisible by 400, it is a common year;
otherwise, it is a leap year.
- Return the number of days in a month
April, June, September, November has 30 days otherwise 31 except for Feb (refer to leap year)
- Print the month in string format followed by the date and year
SAMPLE INPUT1
2020
2
15
SAMPLE OUTPUT1
February 15, 2020
29 days
2020 is a Leap Year
SAMPLE INPUT2
2019
2
29
SAMPLE OUTPUT2
Invalid number of days
SAMPLE INPUT3
2019
3
15
SAMPLE OUTPUT3
March 15, 2019
31 days
2019 is a Common Year
Using multi dimensional arrays, create an array that will store 10 items of stock with brand name. Number of stock in store and Quantity sold
Harold and his homework
Harold and Dan are friends and study in the same class. One day, they strike a deal about completing Harold's homework.
The deal is that, for every piece of homework belonging to Harold which Dan completes, Harold will give Dan some money. The catch is that every piece of homework has a deadline associated with it and has to be completed within that deadline only.
It takes 1 unit amount of time to complete a homework. You have to help Dan find and return the maximum money he can earn.
Input Specification:
input1: The number of tasks
input2: An array representing money associated with each task input3: An array representing the deadline of each task
Output Specification:
Your function must return the maximum amount of money Dan can earn
Example 1:
input1: 3
input2: (20,54,41)
input3: (3,4,5)
Output: 115
Explanation:
Here, all the homework can be done as all have different deadlines and so maximum money is the sum of 20+54+41= 115.
Create a class 'Bank' with a function 'getBalance' which returns 0. Make its three subclasses named 'BankA', 'BankB' and 'BankC' with a function with the same name 'getBalance' which returns the amount deposited in that particular bank. Call the function 'getBalance' by the object of each of the three banks.
LABELLING NUMBERS
0 EVEN
1 ODD
2 EVEN
3 ODD
Write a function named "reduce" that takes two positive integer arguments, call them "num" and "demon", treats them as the numerator and denominator of a fraction, and reduces the fraction. That is to say, each of the two argument will be modified by dividing it by the greatest common divisor of the two integer. The function should return the value 0(to indicate the failure reduce) if either of the two argument is zero or negative and should return the value 1 otherwise.
Create a class named 'Student' with a string variable 'name' and an integer variable
'roll_no'. Assign the value of roll_no as '2' and that of name as "John" by creating an
object of the class Student.
Write a C++ program that will find maximum number in an array.