/*O.k. I am down to a few less errors. I do not understand how to correct them, I have placed the ";" everywhere and it does not make a difference, in fact I get more errors. Still confused!
Thank you. Here it is again.


This is a program that processes a loan for a car using appropriately named variables.
It will use those variables in the input, calculation, and output of this program. This
program works on a payment plan with zero interest and sales tax fixed at 6%. The car
in this program is driven 1000 miles per month.*/

#include <iostream>
#include <string>
using namespace std;

int main ()
{
	int numbers; sales_price = $15000.00, tax = .06, months = 36, miles2 = 36000, miles1 = 12345, sum;
	cout << "enter number 1": << endl;
	cin >> one;
	cout << "enter number 2": << endl;
	cin >> two;
	cout << "enter number 3:" << endl;
	cin >> three;
	cout << "enter number 4:" << endl;
	cin >> four;
	
	total salesprice (after salestax) = sales_price + tax 
    months = months
	miles = miles1 + miles2
	payments = one + two /3

    string name;

	//Variable declarations
	string make, model, year,  answer;
	int year, miles, cost, month, salestax, answer;

	cout << "What is the make of the car?;
    getline (cin,Ford);
	cout << "What is the model of the car?";
	cin >> Bronco;
	cout << "What is the year of the car?";
	cin >> 2005;
	cout << "What is the mileage of the car?";
	cin >> 12345;
	cout << "What is the cost of the car?";
	cin >> 15000;
	cout << "How many months for the loan?";
	cin >> 36;
	cout << "What is the sales tax?";
	cin >> .06;
	cout << "What are the miles per month?"; 
	cin >> 1000;
	cout << "Your 2005 Ford Bronco costs" << cost << "$": after sales_tax" << salestax << "and will cost << cost << "you "$": per month" << month << "for" << months << endl;
	cout << "When it is paid off," << "you will probably have" << miles << "on it." << endl;
}

Errors:

c:\users\carole\documents\visual studio 2008\projects\compsci-assign11\compsci-assign11\compsci-assign11.cpp(57) : error C2143: syntax error : missing ';' before ':'
c:\users\carole\documents\visual studio 2008\projects\compsci-assign11\compsci-assign11\compsci-assign11.cpp(57) : error C2143: syntax error : missing ';' before ':'

Fbody commented: Listen to what people tell you. Don't start a new thread if you don't get an answer immediately or don't understand the answer.. +0
dusktreader commented: Don't start a new thread for a question you are already discussing in another. AND USE CODE TAGS +0

Recommended Answers

All 10 Replies

Use code tags, there are descriptions all over the site. You've been notified before.

You can not cin to a numeric literal, it has to go to a variable you were told that before.

If you want help, you need to listen to what people tell you.

Before you try to tackle the whole problem at once with code you are not sure of, you should try to create a 'toy' problem with only a few lines of code that uses the concepts you need to perfect.

In your case, you need to learn about how cin can be used to store data in local variables. Try to create a very simple program that accepts input using cin, and practice storing user input in a variety of different variable types.

In general, it is a good idea to build software incrementally. That is, you should build small, simple code first that uses the concepts you need, verify that it works and that you understand the concept, and then extend the concepts to your problem.

Look at this example to get a better idea of how to handle input:
http://www.cplusplus.com/doc/tutorial/basic_io/

Gee, I'm sorry. I really don't need attitude, I need help. If you cannot reply in a decent manner, please don't reply. If I understood everything I wouldn't be here. By the way, I do listen. Didn't work. I don't recall that you replied to my first post anyway, or the million errors I had then. I am down to 2. Not too bad for not listening and coming from a field of nursing into this.
If anyone else can explain a little better the errors, I would appreciate it. If not, that's fine also.

Use code tags, there are descriptions all over the site. You've been notified before.

You can not cin to a numeric literal, it has to go to a variable you were told that before.

If you want help, you need to listen to what people tell you.

Gee, I'm sorry. I really don't need attitude, I need help. If you cannot reply in a decent manner, please don't reply.

No one gave you attitude. You have been notified about CODE tags before, and ignored the information.

/*O.k. I am down to a few less errors. I do not understand how to correct them, I have placed the ";" everywhere and it does not make a difference, in fact I get more errors. Still confused!

I see no ';' anywhere in this section:

total salesprice (after salestax) = sales_price + tax 
    months = months
	miles = miles1 + miles2
	payments = one + two /3

I also see no definitions for one, two, three, four which will cause errors. Basically what I see is a list of errors that did not come from the code posted.

As for the errors posted: c:\users\carole\documents\visual studio 2008\projects\compsci-assign11\compsci-assign11\compsci-assign11.cpp(57) : error C2143: syntax error : missing ';' before ':' Look at line 57. Is there a ';' that is missing? Probably from line 54-56 would be my guess.

lines 7 and 17-20 need to be looked at again. there is where some of your errors are coming from.

Also: the syntax highlighting from lines 28 > might give you a clue.

Thank you for the advice. It is appreciated.

Before you try to tackle the whole problem at once with code you are not sure of, you should try to create a 'toy' problem with only a few lines of code that uses the concepts you need to perfect.

In your case, you need to learn about how cin can be used to store data in local variables. Try to create a very simple program that accepts input using cin, and practice storing user input in a variety of different variable types.

In general, it is a good idea to build software incrementally. That is, you should build small, simple code first that uses the concepts you need, verify that it works and that you understand the concept, and then extend the concepts to your problem.

Look at this example to get a better idea of how to handle input:
http://www.cplusplus.com/doc/tutorial/basic_io/

Thank you for the help.

lines 7 and 17-20 need to be looked at again. there is where some of your errors are coming from.

Thank you.

Also: the syntax highlighting from lines 28 > might give you a clue.

cout << "enter number 1": << endl;

the " should be after : not before.

total salesprice (after salestax) = sales_price + tax

u didn't declare the variable total and u can't name variable like this don't put spaces and ( ) in the name of the variable.. u can write it like this

double total_salesprice_after_salestax;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.