C++ Debug HELP

Page 1 of 1

1 Replies - 385 Views - Last Post: 03 November 2009 - 04:16 PM Rate Topic: -----

#1 J.holloway718   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 37
  • Joined: 20-October 09

C++ Debug HELP

Post icon  Posted 03 November 2009 - 04:08 PM

Goal: Prompts the user to input a number and prints to the screen the ceiling and floor of the number.

Main:
Asks the user to begin and to continue using the program.
calls the programmer's defined function
prints the number, ceiling of the number, the floor of the number

Programmer Defined Function:
asks the user to input a number
calculates the ceiling and floor of the number
returns to the main the number, the ceiling and floor number


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

double ceiling & floor(int a, int b );

int main(int argc, char** argv)
{

double num;
int numCeiling;
int numFloor;

cout<< “To begin and continue”<<endl;



cout << "Ceiling: " << numCeiling << endl;
cout << "Floor: " << numFloor << endl;


return EXIT_SUCCESS;
}


double ceiling & floor(int a, int b )
{

while((cout << "Input a number:") && !(cin >> num))
{
cout << "That's not a number." << endl;

cin.clear();

}

numCeiling = ceil(num);
numFloor = floor(num);

}

return 0;

}



ex.cpp:15: error: stray ‘\342’ in program
ex.cpp:15: error: stray ‘\200’ in program
ex.cpp:15: error: stray ‘\234’ in program
ex.cpp:15: error: stray ‘\342’ in program
ex.cpp:15: error: stray ‘\200’ in program
ex.cpp:15: error: stray ‘\235’ in program
ex.cpp:45:2: warning: no newline at end of file
ex.cpp:6: error: expected initializer before ‘&’ token
ex.cpp: In function ‘int main(int, char**)’:
ex.cpp:15: error: ‘To’ was not declared in this scope
ex.cpp:15: error: expected `;' before ‘begin’
ex.cpp: At global scope:
ex.cpp:27: error: expected initializer before ‘&’ token

Is This A Good Question/Topic? 0
  • +

Replies To: C++ Debug HELP

#2 Masterchief117.arbiter   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 159
  • Joined: 27-March 09

Re: C++ Debug HELP

Posted 03 November 2009 - 04:16 PM

hey spambot A) dont repost your topic B) you forgot the code tags "[ code ]" "[ /code ]" and C)this isnt what some of the other members would call advanced !!!!!!!!!!!!!!!!!!!!!!!!!!!

DONT REPOST YOUR TOPIC

This post has been edited by Masterchief117.arbiter: 03 November 2009 - 04:17 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1