Knowee
Questions
Features
Study Tools

Single File Programming QuestionProblem StatementMark wants to calculate his monthly savings based on his salary and a specified savings percentage.Write a program to help Mark that input the monthly salary and the percentage of the salary to save. Use pointers to calculate the amount to save. Display the calculated amount with two decimal places.Input format :The first line of input consists of a floating-point value, representing the monthly salary.The second line consists of a floating-point value, representing the savings percentage.Output format :The output prints a floating-point value, representing the calculated savings amount, rounded off to two decimal places.Refer to the sample output for formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:1.00 ≤ monthly salary ≤ 1,00,000.001.00 ≤ percentage ≤ 100.00Sample test cases :Input 1 :10000.5010.75Output 1 :1075.05Input 2 :80575.2514.50Output 2 :11683.41Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.Marks : 10Negative Marks : 0WhitelistSet 1:*

Question

Single File Programming QuestionProblem StatementMark wants to calculate his monthly savings based on his salary and a specified savings percentage.Write a program to help Mark that input the monthly salary and the percentage of the salary to save. Use pointers to calculate the amount to save. Display the calculated amount with two decimal places.Input format :The first line of input consists of a floating-point value, representing the monthly salary.The second line consists of a floating-point value, representing the savings percentage.Output format :The output prints a floating-point value, representing the calculated savings amount, rounded off to two decimal places.Refer to the sample output for formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:1.00 ≤ monthly salary ≤ 1,00,000.001.00 ≤ percentage ≤ 100.00Sample test cases :Input 1 :10000.5010.75Output 1 :1075.05Input 2 :80575.2514.50Output 2 :11683.41Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.Marks : 10Negative Marks : 0WhitelistSet 1:*

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Here is a step-by-step solution in C++:

#include <iostream>
#include <iomanip>

using namespace std;

int main() {
    // Step 1: Declare the variables for salary and percentage

Similar Questions

Single File Programming QuestionProblem StatementAlice is tracking her academic performance. She scored 5 in a quiz (an integer), received a grade of 5.99 in a project (a float value), and was assigned a grade 'D' for her assignment (a character). Create a C program to print these values with appropriate data types in separate lines.Input format :No console input.Output format :The first line displays an integer representing the score of Alice's quiz.The second line displays a float value representing the grade of Alice's project.The third line displays a character representing the grade of Alice's assignment.Refer to the sample output for the formatting specifications.Sample test cases :Input 1 :Output 1 :55.990000D

Single File Programming QuestionProblem statementDaniel is working on a program for mathematical operations. Create a program that takes two floating-point numbers, multiplies them, converts the result to an integer, and based on the user's choice:If the choice is 1, add 5 to the converted integer.If the choice is 2, subtract 5 from the converted integer.If the choice is 3, divide the converted integer by 2.Display the original multiplication result as a float with two decimal places, and then show the modified integer after the chosen operation. Input format :The first line of input consists of two float values: num1 and num2 separated by a space.The second line of input consists of an integer value n, representing Daniels's choice:If the choice is 1, add 5 to the converted integer.If the choice is 2, subtract 5 from the converted integer.If the choice is 3, divide the converted integer by 2.Output format :The first line displays "Multiplication Result (as float): " followed by the result of multiplying num1 and num2 as a float value with two decimal values.The second line displays "Converted Integer: " followed by the result as an integer value after performing the required operation on the converted result based on the choice.Refer to the sample output for the formatting specifications.Code constraints :In the given scenario, the test cases fall under the following constraints:1.0 ≤ num1, num2 ≤ 100.01 ≤ n ≤ 3Sample test cases :Input 1 :1.0 5.41Output 1 :Multiplication Result (as float): 5.40Converted Integer: 10Input 2 :76.5 100.02Output 2 :Multiplication Result (as float): 7650.00Converted Integer: 7645Input 3 :56.7 64.53Output 3 :Multiplication Result (as float): 3657.15Converted Integer: 1828

Single File Programming QuestionProblem StatementLiam is an international traveller curious about currency exchange rates. Create a simple program to assist Liam in converting a given amount in dollars to Indian Rupees. Input the amount in dollars and display the equivalent amount in Rupees.Note: 1 Dollar = 83.3339 RupeeInput format :The input consists of a double value, dollar, representing the amount in dollars to be converted.Output format :The output displays the dollar amount with two decimal places followed by "Dollar = ", and the corresponding rupee amount with two decimal places followed by "Rupees".Refer to the sample output for the formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:1.0 ≤ dollar ≤ 1000.0Sample test cases :Input 1 :1.0Output 1 :1.00 Dollar = 83.33 RupeesInput 2 :158.8Output 2 :158.80 Dollar = 13233.42 RupeesInput 3 :1000.0Output 3 :1000.00 Dollar = 83333.90 RupeesCode Size : 1024 kbNote :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.

Single File Programming QuestionProblem StatementJamie is managing a school and is looking to find out the number of students in the class based on the sum of their scores and the average score.He wants to design a program that takes the average score and sum of scores as input and outputs the calculated number of students in the class using pointers.Input format :The first line of input consists of an integer value n, representing the sum of scores.The second line of input consists of a floating-point value f, representing the average score.Output format :The output displays the calculated number of students in the class.Refer to the sample output for the formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:1 ≤ n ≤ 1051.0 ≤ f ≤ 100.0Sample test cases :Input 1 :187575.45Output 1 :24Input 2 :20010.25Output 2 :19Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.Marks : 10Negative Marks : 0WhitelistSet 1:*

Problem StatementFin is managing salary taxation and wants a program to determine the net salaries based on the provided salary amount. Determine the net salary: If the salary is less than 50000, print "No Tax." For salaries between 50000 (inclusive) and 100000 (exclusive), apply 10% tax and print the net salary after deduction.For 100000 or more, apply 20% tax and print the net salary after deduction.Implement a program that takes Fin's salary as input (integer) and calculates the net salary after converting it into float.Input format :The input consists of an integer value n, representing Fin's monthly salary.Output format :If no tax is applicable, the output prints "No Tax"If a tax is applicable, the output prints "Salary after X% Tax: Y" where X represents the applicable tax percent value and Y represents the net salary after deduction with two decimal places.Refer to the sample output for the formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:1000 ≤ n ≤ 120000Sample test cases :Input 1 :40000Output 1 :No TaxInput 2 :60000Output 2 :Salary after 10% Tax: 54000.00Input 3 :120000Output 3 :Salary after 20% Tax: 96000

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.