ineed help with c++.
i am using code blocks and i have a problem with the compiler.
when I run this code ¡é
# include <iostream>
using namespace std;
int main()
{
cout<<"Hello World!"<<endl
return(0);
}
this message keep pops up. ¡é
"It seems that this file has not been built yet. Do you want to build it now? (Yes)/(No)/(Cancel)"
this message only dissapears when i click no or cancle.
and they give me this message. ¡é
mingw32-g++.exe -fexpensive-optimizations -Os -O3 -O2 -O1 -O -Wmain -pedantic-errors -pedantic -w -Wfatal-errors -W -Wall -ansi -pg -g -c "D:\Grade 12 Computer Science\CodeBlocks\hello world.cpp" -o "D:\Grade 12 Computer Science\CodeBlocks\hello world.o"
Execution of 'mingw32-g++.exe -fexpensive-optimizations -Os -O3 -O2 -O1 -O -Wmain -pedantic-errors -pedantic -w -Wfatal-errors -W -Wall -ansi -pg -g -c "D:\Grade 12 Computer Science\CodeBlocks\hello world.cpp" -o "D:\Grade 12 Computer Science\CodeBlocks\hello world.o"' in 'D:\Grade 12 Computer Science\CodeBlocks' failed.
Nothing to be done.
Checking for existence: D:\Grade 12 Computer Science\CodeBlocks\hello world.exe
Executing: D:\Grade 12 Computer Science\CodeBlocks/cb_console_runner.exe "D:\Grade 12 Computer Science\CodeBlocks\hello world.exe" (in D:\Grade 12 Computer Science\CodeBlocks)
Process terminated with status -1073741510 (3 minutes, 40 seconds)
can someone tell me what i need to do to solve the problem?
thanks
3 answers
In any case, you need a semi-colon after every C++ statement, and one is missing after endl.
If that doesn't solve your problem, post again with full details.
Note: if you are using dev C++, you will see a black screen appear for about 1/10th of a second and disappears. That is because there is nothing to halt the screen to give you time to read the text displayed. This is a programming problem.
variables, perform mathematical operations, and use control structures to solve application problems; Use
the echo construct and printf function to display output.
Tasks:
An Internet service provider has three different subscription packages for its customers:
Internet Service Packages
Package A: For $19.95 per month, 200 hours of access are provided. Additional hours are
$0.40 per hour.
Package B: For $29.95 per month, 300 hours of access are provided. Additional hours are
$0.35 per hour.
Package C: For $39.95 per month, unlimited access is provided.
Write a web application that allows the customer to enter the letter of the package the customer has
purchased (A, a, B, b, or C, c) and the number of hours that were used in a month, validates user input,
calculates and displays the monthly charge in the browser. It also displays the amount of money the
customer would save if a different package could be chosen.
Watch the video lecture and study code example order_form.html and order_process.php.
Create two files: hw1_form.html and hw1_process.php. The file hw1_form.html provides a
HTML form for a user to enter the package name and the hours used. After the user submits the form,
hw1_process.php processes the data as required.
The specification of the assignment includes the following:
1) Display the Internet Service Packages information to the customer.
2) Display an HTML form that allows the customer to enter the letter of package and the number of
hours used. Use 0 as a default value for the hours used.
3) After the form is submitted, display the customer’s input for the package name and hours used on
a new webpage.
4) Assume we don’t use JavaScript to validate user input on the client side, the validation must be
done on the server side in the hw1_process.php file.
If the customer enters a letter other than lowercase or uppercase letter of A, B, and C, display
“Wrong package entered. Please return to the previous page and enter a valid package name.” on
the webpage.
If the number of hours is negative, display “The number of hours must be non-negative. Please
return to the previous page and enter a valid value.” on the webpage.
5) Calculate the customer’s monthly charge and display it on the webpage. The currency should be
displayed with 2 decimal places as shown in the sample output. (Hints: Use the printf function.)
6) Display how much money the customer would save if he/she switches to other packages. If there
would be no savings by switching to other packages, display “You chose the best package.”.
7) Wherever possible, use named constants instead of numbers, for example, package base cost, free
hours for a package, and additional hour cost.
8) Use an HTML fieldset to display “BCS350 Assignment 1” followed by your name on the top of
both web pages. Please see sample output below. You are free to decide the styles of your pages.