display personal info using cin
Write a C++ program creating a class for workers mentioning their id, name and group to which they belong. Compute their weekly wages for the number of hours they work, fixing a nominal pay rate which is a sensitive data. Include the required Accessor and mutator member functions to set and display the wages.
Command Line Argument - Count
Write a program to accept strings as command-line arguments and print the number of arguments entered.
Sample Input (Command Line Argument) 1:
Command Arguments
Sample Output 1:
Arguments :
Command
Arguments
The number of arguments is 2
Sample Input (Command Line Argument) 2:
Commands
Sample Output 2:
Arguments :
Commands
The number of arguments is 1
Command Line Argument - Print String
Write a program to accept a string as a command-line argument and print the same.
Sample Input (Command Line Argument) 1:
Programming
Sample Output 1:
Programming - Command Line Arguments
Sample Input (Command Line Argument) 2:
Arguments
Sample Output 2:
Arguments - Command Line Arguments
Recursion 3: Compute a^n
Write a program to compute a^n (a power n) using recursion.
Note:
Refer to the problem requirements.
Shell Scripting Function Specifications:
Use the function name as computePower() and the 2 integer arguments.
This function returns an integer value that is 'a power n'.
Function specification:
int computePower(int a,int n)
Input and Output Format:
Input consists of 2 integers.
The output is the a power n.
Refer sample input and output for formatting specifications.
Sample Input and Output:
[All text in bold corresponds to input and the rest corresponds to output.]
Enter the value of a
2
Enter the value of n
8
The value of 2 power 8 is 256
Many programming languages, especially older ones, provide no language support for concurrency. C and C++ are examples of such languages. Is it essential that a language include syntax for concurrency to be able to write concurrent programs in that language? If not, how is it accomplished? What are the advantages and disadvantages of including support for concurrency in a language?
Three employees in a company are up for a special pay increase. You are given a file, say Ch3_Ex5Data.txt, with the following data:
Miller Andrew 65789.87 5
Green Sheila 75892.56 6
Sethi Amit 74900.50 6.1Each input line consists of an employee’s last name, first name, current salary, and percent pay increase.
For example, in the first input line, the last name of the employee is Miller, the first name is Andrew, the current salary is 65789.87, and the pay increase is 5%.
Write a program that reads data from a file specified by the user at runtime (i.e. your program should accept the filename as user input) and stores the output in the file Ch3_Ex5Output.dat. To test your program, use the Ch3_Ex5Data.txt file.
Your program will not pass all checks if it does not accept a filename as input from the user.
For each employee, the data must be output in the following form: firstName lastName updatedSalary.
A box of cookies can hold 24 cookies, and a container can hold 75 boxes of cookies.
Write a program that prompts the user to enter:
The program then outputs:
Note that each box must contain the specified number of cookies, and each container must contain the specified number of boxes. If the last box of cookies contains less than the number of specified cookies, you can discard it and output the number of leftover cookies.
Similarly, if the last container contains less than the number of specified boxes, you can discard it and output the number of leftover boxes.
Suppose that billingAmount is a double variable, which denotes the amount you need to pay to the department store. If you pay the full amount, you get $10.00 or 1% of the billingAmount, whichever is smaller, as a credit on your next bill; If you pay at least 50% of the billingAmount, the penalty is 5% of the balance; If you pay at least 20% of the billingAmount and less than 50% of the billingAmount, the penalty is 10% of the balance; otherwise the penalty is 20% of the balance. Design an algorithm that prompts the user to enter the billing amount and the desired payment. The algorithm then calculates and outputs the credit or the remaining balance. If the amount is not paid in full, the algorithm should also output the penalty amount.
Since your program handles currency, make sure to use a data type that can store decimals with a precision to 2 decimals.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.