i tried copying an example from the textbook straight onto my IDE and i'm getting a bunch of errors...even though i've copied everything exactly what is on the textbook :/ halp
@Ultrilliam
i moved the open curly bracket to line 6 and i'm still getting the same bucket of errors in the end... :/ why?
Please copy+paste the code in codeblocks like here: ``` //code ``` Like this: \``` Code here \```
``` //This program calculates the user's pay #include <iostream> using namespace std; int main() [ double hours, rate, pay; //Get the number of hours worked. cout <<"How many hours did you work? "; cin >> hours; //Get the hourly pay rate. cout << "How much do you get paid per hour? "; cin >>rate; //Calcualte the pay. pay = hours * rate; //Display the pay. cout << "You have earned $" << pay << end1; return 0; ] ```
ok, wait a minute
ok sir
``` //This program calculates the user's pay #include <iostream> using namespace std; int main() { double hours, rate, pay; //Get the number of hours worked. cout <<"How many hours did you work? "; cin >> hours; //Get the hourly pay rate. cout << "How much do you get paid per hour? "; cin >>rate; //Calcualte the pay. pay = hours * rate; //Display the pay. cout << "You have earned $" << pay << end1; return 0; } ```
Why were they square brackets
where? :O
I changed it, the main function was square brackets not curly brackets, lol
oof omg o///o
sorry, i didn't look close enough to realize those were square brackets. Let me go run this thing real quick ... and thanks for catching my mistake pal :)
Np, lol
yayy!! it works :)))))
actually nvm... another error o///o
what have i done wrong now ? :/
``` //This program calculates the user's pay #include <iostream> using namespace std; int main() { double hours, rate, pay; //Get the number of hours worked. cout <<"How many hours did you work? "; cin >> hours; //Get the hourly pay rate. cout << "How much do you get paid per hour? "; cin >>rate; //Calcualte the pay. pay = hours * rate; //Display the pay. cout << "You have earned $" << pay << endl; return 0; } ```
It's endl, not end1
i knew that but i looked close in my textbook and it kinda looks like 1 tho :/ k let me change that to endl....aka end line
it works!!! yay!!
ultri, do you know of any website that gives small programming tasks to students to help them get started ???
i don't have any programming experience and i'm absolutely itching to have real experince with IDE and code making... im sick of taking notes blindly
Uhhh, I THINK khan academy does, but I don't recall for sure
ok let me try them and i'll let chew you. Thanks buddy. thanks a lot for your help pal. :) <3
Join our real-time social learning platform and learn together with your friends!