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

There is a chocolate vending machine.intially it contains a total of K chocolates N people are standing in a queue from left to rigth.Each person wants to withdraw chocolates.The i-i-th person wants to take Ai units of chocolates.People come in and try to withdraw chocolates one by one,in the increasing order of their indices.Whenever someone tries to withdraw chocolate,it will give them.Otherwise,it will throw an error and not give out anything in that case this person will return home directly without trying to do anything else for each person determine whether they will get the required amount of chocolate or not

input:The 1st line of input contains a single integer T denoting the no.of test cases the description of T test cases follows

the first line of each test case contais two separated integers N and K

the second line contains N space-separated integers A1,A2,A3----AN

INPUT:

2

5 10

3 5 3 2 1

4 6

10 8 6 4

OUTPUT:

11010

0010

INPUT:2

6 15

16 1 2 6 4 5

10 5

1 2 6 5 4 3 2 1 1 1

OUTPUT:

011110

1100001000


In rahul's school every student is uniquely identified by a string which is printed on the id card of the student .This unique id is comprised of letters and digits separated by hyphens into groups of different lengths.The college administration decides to standardize this unique id on the id card by regrouping the letters of the previous unique id to a fixed group length.the college administration also does not want to have lowercase letters in the new id.you need to help the college administration with this task.Given the previous id,and the no.of characters to group,you need to generate the new id

note:while generating the new unique id ,group the characters from right to left

input:the 1st line containing a string S representing a unique id.

the 2nd line containing an integer N representing group length

i/p:2-4A0r7-4k

3

o/p:24-A0R-74K

i/p:

5F3Z-2e-9-w

4

O/P:5F3Z-2E9W


Create a complex program that applies control structure, iterative, array .


The National Bank of the Caribbean wants to have a car loan calculator designed and implemented using C++. You have been asked to design a class that will determine the monthly payment on a motor vehicle based on the total years allotted for the loan. The monthly payment with interest compounded monthly can be calculated as follows: loan* rate 0/12 * term , where term = 1+ rate /12 !"∗ %&'() Payment = the monthly payment Loan = the dollar amount of the loan Rate = the annual interest rate Years = the number of years of the loan The class should have member functions for setting the loan amount, interest rate, and number of years of the loan. It should have member functions for returning the monthly payment amount and the total amount paid to the bank at the end of the loan period. Implement the class in a complete program (loan.h, loan.cpp, driver.cpp)


1111#Bill#Jones#55895.25
1234#Mary#Smith#95875.50
2222#Andile#Makanda#67892.00
2223#Susan#Stofberg#43569.35
3345#Lihle#Tshabalala#88795.75
2323#Steve#Adams#55890.80
4333#Siya#Mlenga#64290.50
3445#Khaya#Poswa#27850.55
5677#Jimmy#Davis#57860.95

1. Open and read the input txt file, StaffData.txt.

2. Create an object of type Staff representing each input line.

3. Add each Staff object to an arraylist.

4. Close the input file.

5. Open an output txt file.

6. Sort the objects in the arraylist in alphabetical order of surname.

7. Loop thru your arraylist and write all the staff objects with a salary exceeding

R50 000 to the output file. Use the printToFile () method.

Include appropriate headings.

Include a count of the number of staff members written to the file at the end of the report.

8. Close the output file.


The following program has some problems with input data. Rewrite the following program in such a way to validate the input data.

Run your program with the following inputs:

95

150

-66

77

B

45

$$

69

Submit screenshots with all the output runs


You have been contracted by Toyota Zambia to design a system that can make the Toyota Mark

X a smart vehicle. The company has proposed to install four infrared radars on the car, just

below each light set, to use as sensors. Each sensor has a range of 20m. The company wants the

car to be able to avoid collisions at the rear, and the front, and to be able to auto accelerate to a

recommended spend if the course is clear or when collision is eminent at the rare and the front is

clear, and to be able to overtake a vehicle on the road without causing any accident. The sensors

can pick human body heat at a distance of 15m, and a vehicle body heat at 20m.

a. Using a pseudocode, show the algorithm for the car system, an remember that it

is using four sensors, one at each vehicle corner. With swaying to the right if the

left is not clear and vice versa, till it stops or it continues to correct its paths if the

course is clear.

b. Using C++, write a source code for the car smart system


Write a C++ program which takes multiple Employees information (records) as inputs from the


user and save them on a file using class. Writing in file should be done using setters. Perform


following operations on the data saved in the file:


• Read data from file


• Search an employee’s information in the file


• Count the number of employees having salary more than 50,000.

What is the output of this program and can you answere me that where and how they (0*000),(1500.99),(1000),(1BM) came?

Write a C++ program which takes 5 students’ information (records) as inputs from the user and


save them on a file. Your program should have two options: writing and searching.



When a user selects writing option, you are required to take three inputs from the user: student


name (string type), student age (int type). After reading these data-items write to the file named “student.txt”. Please note: write data using append mode otherwise previous information will be lost.



Your program should have a search function. The search function should provide three options


for searching: by name, by age, or by registration number. After selection of the search option


by the user, please take input (name, age, or registration number) and search that student from the


file and display its record on the screen.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS