Purchase Solution

Error in C Programming Code

Not what you're looking for?

Ask Custom Question

Below is the error message when trying to compile the code.

In function `float totalSale(float, float, float)':

83 redeclaration of `float purchaseAmount'

83 `float purchaseAmount' previously declared here

Attachments
Purchase this Solution

Solution Summary

This solution helps solve an error in C programming code.

Solution Preview

Please check the attachment.
You will no longer get float purchase amount error.
If you have any questions please let me know.

#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

float calculateTax(float, float); //function prototype to get sales tax
float totalSale(float, float); //function prototype to get total sale value

main() //main method start point

{ // start of logic block

//variable initialization

float purchaseAmount = 0.00;
float storeTaxRate = 0.00;
float taxAmount = 0.00;
char purchaseAmount1 = '0';
char menuResponse = 's';

printf("nTax Calculator Version 5.0n");
printf("nby Harold Bryant Versionn");

do{

printf("nEnter s to start program or e to exit: ");
scanf("%c", &menuResponse);

...

Purchase this Solution


Free BrainMass Quizzes
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.

C# variables and classes

This quiz contains questions about C# classes and variables.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Javscript Basics

Quiz on basics of javascript programming language.