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

Using List in C#. Write a program that can input 5 numbers then list in sorted form then after, insert another one number.


 

 The class ExpenseLedger will record all the expenses you make. You record an expense by giving it a serial number, a description and the money you spent on this item. So you need to create a class ExpenseItem with serial, description and amount. Now in the ExpenseLedger class you need to build a collection that will hold the instance of ExpenseItem. Provide the following methods in the ExpenseLedger 

void addExpense(description, amount): You should be able to figure out the serial of the expense yourself. This method will create an expense item and add it to the ledger int removeSmallExpenses(double amt):This method will find the expense items that are smaller or equal to the amount amt and then remove these items from the list. Note that multiple items can be smaller than this value and thus each of these should be removed. Also this method should return the number of items removed. double totalExpenditure(): This method will calculate the total expenditure recorded in the ledger so far.


Implement following class hierarchy using multi level inheritance.



School




Department




Teacher




Data member's are as follows: School: School Name, Number of department Department: Department Name, Number of employee Teacher: Teacher Name, salary of the teacher.

5. Groupings


by CodeChum Admin




Instructions:



1. Create a variable that accepts a positive odd integer.



2. Create an empty list. Then, using loops, add random integer values into the list one by one. The number of values to be stored is dependent on the inputted odd integer on the first instruction.



3. Reverse the order of the list. Then, print out the list's new order in this manner:



4. [first-half values]-[middle value]-[second-half values], just like that of the sample output. Make use of list slicing that you’ve learned from the past lessons to easily achieve this segment.




Input



The first line contains an odd positive integer.


The next lines contains an integer.



5


1


3


4


5


2




Output



A line containing a list.



[2,5]-[4]-[3,1]

Using Switch statement, write a program that displays the following menu for the bank operations available to take services from the customer: 

D= Deposit, W= Withdraw T= Transfer

The program inputs the type of service and amount. It finally displays the amount to be transfer/deposit/transfer after applying charges, total remaining balance of customer according to the following criteria:

Deposit = 0.5% charges of deposited amount

Withdraw = 1.5% charges of withdraw amount

Transfer = 2.5% charges of transfer amount


Write the class definition for a Car class. Provide the following data members:



 A C-string called make of size 20 to store the car manufactures name, e.g. Ford, Toyota,



….;



 In integer called year to hold the year of first registration of the vehicle;



 A floating point called km to contain the number of kilometers traveled for the trip;



 A floating point called liter to contain the liters used to cover the distance;



 A floating point called consumption is the calculated value of liter per km.



 Class-wide floating point called expense, for the cost per kilometer, which should be



initialized to R7.55.



The class also contains the following methods:



 A default constructor that will set the data members to appropriate default values if



nothing is sent to it, and set them to the values sent as parameters if parameters are



received.




c++ program to find the factorial of any number between 3 and 9

Write the following non-member functions:



 readFile that receives an array of Cars and the maximum number of cars that can be



read into the array, and will read the car information stored in Question 1 in file car.txt



and set the objects in the Car array to these values. Ensure that you do not go past the



boundary of the array. This function will return the updated Car array and the number



of cars that were entered.

Design a program that generates the general average of four grading systems (Prelim, Midterm, Prefinals and Finals). Display the remarks and Equivalent Grade as output based on the following given scale. *

Instructions:

  1. Input a 3-digit integer.
  2. Print the largest digit in the integer.
  3. Tip #1: Use % 10 to get the rightmost digit. For example, if you do 412 % 10, then the result would be the rightmost digit, which is 2.
  4. Tip #2: On the other hand, use / 10 to remove the rightmost digit. For example, if you do 412 / 10, then the result would be 41.
  5. Tip #3: You'd have to repeat Tip #1 and Tip #2 three times for this problem because the input is a 3-digit integer.

Input


1. A three-digit integer

Output


The first line will contain a message prompt to input the 3-digit integer.

The last line contains the largest digit of the inputted integer.

Enter a 3-digit integer: 173
Largest = 7


Enter a 3-digit integer: 109
Largest = 9


Enter a 3-digit integer: 666
Largest = 6
LATEST TUTORIALS
APPROVED BY CLIENTS