1. Write a program that calculates sales price of each article. The program will get the unit price of each article through the keyboard, and then calculate actual sales price. Actual sales price of each article is calculated as follows: • Sales Price = (2 x unit price) + (unit price x sales tax) Sales tax for each item is fixed to 5%. Your program should keep asking user to input unit price. If the user does not have any more articles to calculate sales price, then allow user to input -1 to stop calculating. Once a user input -1, your program should be terminated. The numbers used in the program represent dollar amounts. Therefore, your program allows only two decimal places. Your output should be similar to the following:
code in c:
#include <stdio.h>
struct MyStruct //struct to read float variable
{
float p;
} newMyStruct;
int main(void) {
// your code goes here
float up,sp,st; // declaring variables
st = 0.05; //sales tax
int looper =0;
while (looper<1 ) //loop to check -1 input from
user
{
printf("Enter unit price of article:\n");
scanf("%f",&(newMyStruct.p));
up =newMyStruct.p;
if (up==-1.000000)
{
looper++;
printf("Program exits....");
}
else
{
sp =(2*up +up*st);
printf("sales price is %.2f\n",sp);
//calculations
}
}
return 0;
}

1. Write a program that calculates sales price of each article. The program will get the...
For C# The manager of an event venue wants you to write a program that calculates the total ticket sales after each event. There are four types of tickets: orchestra ($100) floor ($75) tier 1 ($50) tier 2 ($40) tier 3 ($35) The user should be asked for what level do they have tickets and how many. Please note: this program should only accept one type of ticket. After each event, data is input by the user and then displayed...
Write a C++ program that calculates the discount of the original price of an item and displays the new price, and the total amount of savings. This program should have a separate header (discount.h), implementation (discount.cpp) and application files (main.cpp). The program must also have user input: the user must be prompted to enter data (the original price, and the percent off as a percentage). There must also be a validation, for example: Output: “Enter the original price of the...
Answer using C++ Write a program that will calculate the final sales price of a motorcycle; this includes additional optional packages along with sales tax. You may assume that the base? price of the motorcycle is $30,000. First you must ask the user to choose which optional packages they want. The user is only permitted to choose one package. Your program should display a menu of the available packages. The user should enter the package by entering the letter associated...
Write a java programm that calculates the total of a retail sale should ask the user for the following: The retail price of the item being purchased The sales tax rate Once these items have been entered, the program should calculate and display the following: The sales tax for the purchase The total of the sale I tried doing it here. but it is not giving me the right answer. kindly help correct the errors. import java.util.Scanner; public class SalesTax...
Complete the missing parts of java source code //This program calculates a running total. Here is the problem definition //Data Express, an Internet Service Provider, has requested that you develop a program to allow //sales representatives to calculate a running total of their sales based on a number of days. //The program prompts the salesperson “How many days do you have sales figures? “. //The number of days must be between 1 – 4 days (keep asking the user until...
Python Simple Programming Write a program in Python that calculates the tip and total for a meal at a restaurant. When your program is run it should ... Calculate the tip and total for a meal for a restaurant Print the name of the application "Tip Calculator" Get input from the user for cost of meal and tip percent Print the tip and total amounts. The formula for calculating the tip amount is: tip = cost of meal * (tip...
In C++ Write a program that calculates the occupancy rate for a hotel. The program should start by asking the user how many floors the hotel has. A loop should then iterate once for each floor. In each iteration, the loop should ask the user for the number of rooms on the floor and how many of them are occupied. After all iterations, the program should display how many room the hotel has, how many of them are occupied, how...
Part A) Write a C++ program that calculates the area under a curve. Here is the equation: f(x) = x^2 +1.5x +4 You must prompt the user for the beginning and the ending x values. You are to assume, but not check, that the user will put in whole positive numbers. The units are inches. The program input/output should look something like this: This program calculates the area under a curve between two points on the x axis. The equation...
USING PYTHON PLEASE
Write a program that calculates the factorial value of a number entered by the user. Remember that x! =x* (x-1)* (x-2)*... *3+ 2* 1. Your program should check the value input by the user to ensure it is valid (i.e., that it is a number > =1). To do this, consider looking at the is digit() function available in Python. If the user enters an incorrect input, your program should continue to ask them to enter a...
(COs 1 and 8) Create a Python program that calculates the tip and total for a meal at a restaurant. Paste Python code here; output not required. Sample output: Tip Calculator Enter cost of meal: 52.31 Enter tip percent: 20 Tip amount: 10.46 Total amount: 62.77 Specifications: •Input: costOfMeal, tipPercent The formula for calculating the tip amount is: tip = costOfMeal * (tipPercent / 100) • The program should accept decimal entries like 52.31 and 15.5. • Assume the user...