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

Interest on a credit card's unpaid balance is calculated using the average daily balance. Suppose that netBalance is the balance shown in the bill, payment is the payment made, d1 is the number of days in the billing cycle, and 2 is the number of days payment is made before billing cycle. Then, the average daily balance isc

average Daily Balance (net Balance" di-payment d2)/d1

If the interest rate per month is, say, 0.0152, then the interest on the unpaid balance is

interest average DailyBalance 0.0152

Write a program that accepts as input netBalance, payment, d1, 2, and interest rate per month. The program outputs the interest. Format your output to two decimal places.
Given an integer N, write a program that prints the count of the total number of digits between 1 and N.

Input
The input is a positive integer.

Output
The output should be a single line containing the count of the digits up to the given number.

Explanation
Given N = 10

From 1 to 9, each number contains a single digit. From 10 onwards, the numbers contain two digits.

So the output should be 9 + 2 = 11.

Suppose we have 999 records of employees Emp1, Emp2, Emp5, Emp6 and so on up to Emp998 and Emp999 stored in a sequence. Hence, records are nothing but a row in the table. In the employee table, we want to insert new records Emp3 and Emp4 in the sequence, and once we have done insertion we need to update and retrieve the record efficiently to optimize the performance of a database by minimizing the access time when query is being executed.

You are required to solve the problem with the index sequential access method with pros and cons in the given scenario.



1. Write a program to swap all the elements in the 1st column with all the corresponding elements in the last column, and 2nd column with the second last column and 3rd with 3rd last etc. of a 2-D array by using functions & dynamic memory allocation. Display the matrix.


2. Given array of integer, write a program to find the next smaller of next greater element of every element in array by using functions & dynamic memory allocation. Elements for which no greater element exists or no smaller of greater element exist, print -1.

Sample Input & Output

Input : arr[] = {5, 1, 9, 2, 5, 1, 7}

Output: 2 2 -1 1 -1 -1 -1

Explanation :

Next Greater -> Right Smaller

5 -> 9 9 -> 2

1 -> 9 9 -> 2

9 -> -1 -1 -> -1

2 -> 5 5 -> 1

5 -> 7 7 -> -1

1 -> 7 7 -> -1

7 -> -1 -1 -> -1


Input : arr[] = {4, 8, 2, 1, 9, 5, 6, 3}

Output : 2 5 5 5 -1 3 -1 -1 


Please correct these code;--

def read_matrix():

   line = input()

   words =line.split()

   n = int(words[0])

   m = int(words[1])

   mat = []

   for i in range(n):

       row = []

       line = input()

       words = line.split()

       for j in range(m):

           row.append(int(words[j]))

       mat.append(row)

   return mat

def print_zig_zag(mat):

 


Zig-zag order in matrix;;

Input:---

4 4

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

Output :--

1 2 3 4 5 6 7 8 9 10 11 12 16 15 14 13


Given a string in camel case, write a python program to convert the given string from camel case to snake case.

how to slove and what is wrong in my code



w = input() 

first_char = w[0]

first_char = first_char.lower()

#print(first_char)

remining_chars = w[1:] 

capl = 0

for char in remining_chars:

  if char == char.upper():

    break

  capl -= 1

   

lower = w[:capl].lower()

new = w[lower:] 

print(new)


Write a class local phone that contains an attribute phone to store a local phone number. The class contains member functions to input and display phone number. Write a child class NatPhone for national phone numbers that inherits localPhone class .It additionally contains an attribute to store city code .. It also contains member function to input and show the city code. Write another class IntPhone for international phone numbers that inherits' Natphone class\.It additionally contains an attribute to store country code. It also contains member functions to input and show the country code. [01]

Last half of List:

You are given an integer N as input. Write a program to read N inputs and print a list containing the elements in the last half of the list.

Input

The first line of input is an integer N. The second line contains N space-separated integers.

Explanation

Sample Output 1

In the example, we are given

6 numbers 1, 2, 3, 4, 5, 6 as input.

The last half of elements of the list are 4, 5, 6. So, the output should be [4, 5, 6].

Sample Output 2

In the example, we are given

5 numbers 1, 11, 13, 21, 19 as input. The last half of elements of the list are 21, 19. So, the output should be [21, 19].

Sample Input 1

6

1 2 3 4 5 6

Sample Output 1

[4, 5, 6]

Sample Input 2

5

1 11 13 21 19

Sample Output 2

[21, 19]




First and Last Elements of List

You are given an integer N as input. Write a program to read N integers and print a list containing the first and last two inputs.

Input:

The first line of input is an integer N. The next N lines each contains an integer.

Explanation:

In the given example, we are given

6 numbers 1, 2, 3, 4, 5, 6 as input.

The list should contain first two integers 1, 2 and last two integers 5, 6 So, the output should be [1, 2, 5, 6].

Sample Input 1:

6

1

2

3

4

5

6

Sample Output 1:

[1, 2, 5, 6]

Sample Input 2:

5

1

11

13

21

19

Sample Output 2:

[1, 11, 21, 19]




Write c++ Program using files for employees
LATEST TUTORIALS
APPROVED BY CLIENTS