Purchase Solution

C program to calculate and display sales of a store

Not what you're looking for?

Ask Custom Question

********************************************************************
Service Request: SR-kf-008

Change Request: 2

Requestor: Harvey Stephens

Modify the C program so that the user inputs the purchase amount. Check the user's input for validity.
Have the user select from a menu which store to use for the tax calculation.
Calculate and display the tax amount for the store selected and the total sale amount for that store.
********************************************************************/

/**************************************************************************
Service Request: SR-kf-008

Change Request: 1

Requestor: Harvey Stephens

Modify the C program so that the user inputs the purchase amount.
Check the user's input for validity. In addition to calculating the sales tax for each location,
calculate and display the total sale amount for each location.

********************************************************************/

Purchase this Solution

Solution Summary

Demonstrates the use of an array to hold tax rates for different stores.

Solution Preview

A float array tax[] is used to replace the define statements which were holding the tax rates for different stores. C code and executable are attached.

#include <stdio.h>

/*Using define macros for assigning tax to different stores */
#define DelMar 7.25
#define Encinitas 7.5
#define LaJolla 7.75

/*
Input:
? Del Mar - 7.25%
? Encinitas - 7.5%
? La Jolla - 7.75%

Output:
The sales tax amount for each store of the 125.00 Purchase for each.
*/
float user_input(){
float amount;
printf("Please Enter the sales amountn");
scanf("%f", ...

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.