Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

1. The program should initialize with two variables, one called balance that starts with a float of 0, and one called otherBalance that also starts with a float of 0. [5% marks] 2. Create the following functions: i) getBalance() [5% marks] ■ This should only return the value of balance ii) getOtherBalance() [5% marks] ■ This should only return the value of otherBalance iii) printBalances() [10% marks] ■ This should call getBalance() and getOtherBalance(), and print the returned values out with a dollar symbol and two decimal places (i.e., $10.99) (Hint: you can use format() function here to print the returned values) iv) deposit(money) [15% marks]


Develop a program to read the name, birthday and gender of a person from a file and output the name and ten-digit identity card (NIC) number to another file , each name starting on new line (see

The only input to the program is the name of the file. The output of the programme is the file "output.txt".
rules for NIC number.
The first four digits of the ID card is the birth year.
The next three digits are the number of days to the birth date from January 1st of that year. If the person is a female, 500 is added to that value.
The next three digits are assigned in the order of submission for a particular birth year.
The input file contains the records in the order of submission where each attribute is space separated.
In example , Aruni is the second entry in the year 1990. Therefore the last three digits of the NIC are 002.
Assume there are only 999 entries per year.
Example:
Saman 1990-05-03 M
Aruni 1990-04-06 F

Saman 1990123001




You may use the function,

days_to_birthday(date)

Alphabetic Symbol

Write a program to print the right alphabetic triangle up to the given N rows.Input


The input will be a single line containing a positive integer (N).Output


The output should be N rows with letters.

Note: There is a space after each letter.Explanation


For example, if the given number of rows is 4,

your code should print the following pattern.

A 
A B 
A B C 
A B C D




Sample Input 1

4

Sample Output 1

A

A B

A B C

A B C D

Sample Input 2

6

Sample Output 2

A

A B

A B C

A B C D

A B C D E

A B C D E F




Right Triangle

Given a number N, write a program to print a triangular pattern of N lines with numbers as shown below.Input


The input will be a single line containing a positive integer (N).Output


The output should be N rows with numbers.

Note: There is no space between the numbers.Explanation


For example, if the given number of rows is 4,

your code should print the following pattern


1
121
12321
1234321



Sample Input 1

4

Sample Output 1

1

121

12321

1234321

Sample Input 2

9

Sample Output 2

1

121

12321

1234321

123454321

12345654321

1234567654321

123456787654321

12345678987654321




Create a c structure to represent a rectangle with width and height. Create a rectangle object and find the perimeter of the rectangle



Evens and Odds


Write a program to count even and odd numbers in given range [M, N]. Both M, N are inclusive in [M, N].

Input


The first line of the input will be an integer(M).

The Second line of the input will be an integer(N).

Output


The first line of output should be a number of odds count.

The second line of output should be a number of even counts.

Explanation


For example, if the given range is 2 to 11

odds numbers in the range are 3, 5, 7, 9, 11 then count is 5.

even numbers in the range are 2, 4, 6, 8, 10 then count is 5.



Sample Input 1

2

11

Sample Output 1

5

5


Sample Input 2

-5

7

Sample Output 2

7

6


Write a program that follows the below rules: Scenario 1:Your friend is going to be another 15 minutes or more

Result: If you have more than 5 AED in change, go buy a coffee, otherwise go for a walk around the town


Scenario 2: Your friend is going to with you in less than 15 minutes

Result: Sit in the food zone and wait


Question 4. Create a table Employee(E_ID PRIMARY KEY, F_NAME ,L_NAME , SALARY, JOINING_DATE ,DEPT_ID)

Create a table Department(DEPT_ID, DEPT_NAME, MGR_ID, LOC_ID)

For each of the above attributes, define their corresponding data types as per your understanding.

Write an SQL query to Insert 6 tuples to each table
Write an SQL query to fetch the departments that have less than one person in it.
Write an SQL query to fetch employee names with salaries >= 40000 and <= 100000.
Write an SQL query to print details of the Employee whose FIRST NAME ends with ‘n’ and contains six alphabets.
Write an SQL query to print details for department excluding department name as “HR” and “IT” from department table.
Write an SQL query to Add a new column to the table employee with the column name as Email_id.
Write an SQL query to rename the table employee to employees and department to departments.
Write an SQL query to List out the maximum salary of the employee.

You want to start a two-piece band, but first you need a friend to join it. If you have a musical friend, you next need to check (using a nested ifstatement) that they actually play an instrument you want in the band. You decide that they need to play either guitar or drums to join.

Write a program that checks to see if you can start a band! You should use the following variables to write your program:

bool musicalFriend = true; string friendPlays = "guitar";


Ordered Matrix

Given a M x N matrix, write a program to print the matrix after ordering all the elements of the matrix in increasing order.Input


The first line of input will contain two space-separated integers, denoting the M and N.

The next M following lines will contain N space-separated integers, denoting the elements of each list.Output


The output should be M lines containing the ordered matrix.

Note: There is a space at the end of each line.Explanation


For example, if the given M is 3 and N is 3, read the inputs in the next three lines if the numbers given in the next three lines are the following.

1 20 3
30 10 2
5 11 15


By ordering all the elements of the matrix in increasing order, the ordered matrix should be

1 2 3
5 10 11
15 20 30

Sample Input 1

3 3

1 20 3

30 10 2

5 11 15

Sample Output 1

1 2 3

5 10 11

15 20 30

Sample Input 2

2 5

-50 20 3 25 -20

88 17 38 72 -10

Sample


LATEST TUTORIALS
APPROVED BY CLIENTS