Write a c++ program for inventory management system for a small convenient store
Write a C++ program that will prompt the user to enter the detail of a car as shown on
Question 2: 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.
Using if...else if statement, make a program that will ask a number and determine if the inputted number is "positive", "negative", or "zero" c++
A storage container only contain one and a half metric ton of sugar one metric ton is approximately 1000 kg’s. Write a C++ program in which, take the amount of sugar in kg’s a bag can hold and the price of sugar (per KG). Calculate the number of bags needed to store one and a half metric ton sugar and the price of each bag.
pseudo
We need to implement some shuffling of two lists. 1. Provide a function which takes two lists and shuffles them. This shuffling should go in an alternating way. First node from first list, second node front second list, third node front first list, 4th node front second list……. So on. If length of list 1 is greater than size of list 2, start again from the first node and follow the same procedure.
1. Provide a function which takes two lists and shuffles them. This shuffling should go in an alternating way. First node from first list, second node front second list, third node front first list, 4th node front second list……. So on. If length of list 1 is greater than size of list 2, start again from the first node and follow the same procedure.
Using a do-while loop, re-implement the calculator program that we implemented in class. But, instead of using switch cases to detect the operand, you should use vector<char> to store operands(e.i ‘+’, ‘-’ etc) and process it when the user enters an expression to be evaluated. Your program should be able to process the following inputs: 5+5, 12*13, 12/6, etc.
Algorithm addingLargeNumbers()
a create 3 empty stacks of integers (stack1, stack2, & result-stack)
b read numerals (digits) of first no & store nums corresponding to them on stack1
c read numerals (digits) of second no & store nums corresponding to them on stack2
d integer carry = 0
e while at least 1 stack is not empty
i pop a no from each nonempty stack & add them to carry
ii push unit part of sum on result-stack
iii store carry in carry
f push carry on result-stack if it is not zero
g pop numbers from result-stack & display them
Write C++ program for adding 2 very large nums
1 Use Stack class to store integers
2 Program should read 2 numbers from console & store them as 2 strings
Suppose max no of numerals (digits) in a no is 30
3 After reading input determine sum of 2 large numbers by above algorithm & print on console
Input
123456789123456789123456789
123454321123454321123454321
Output
23456789123456789123456789
123454321123454321123454321
246911110246911110246911110
Steve has a string of lowercase characters in range ascii[‘a’..’z’]. He wants to reduce the string to its shortest length by doing a series of operations. In each operation, he selects a triple of adjacent lowercase letters that match, and he deletes them. For instance, the string aaab could be shortened to b in one operation. Steve’s task is to delete as many characters as possible using this method and print the resulting string. If the final string is empty, print "Empty String" without quotes. Characters can be deleted only if they form a triple and are the same(i.e. from aaaa we can only delete 3 a's and will be left with a single a).
Example:
Sample Input: aaaabcccdd
Sample Output: abdd
Will the following lines of code print the same thing? Explain why or why not.
x = 7
print(x)
print("x")