I ran the program in Xcode with Java Tools:

#include <iostream>

using namespace std;

main() {

int employeeid;

int hoursworked;

float hourlyrate, grosspay, taxamount, netpay;

float const TAXRATE = 0.10;


cin >> employeeid;


cin >> hoursworked;


cin >> hourlyrate;

grosspay = hoursworked * hourlyrate;

taxamount = grosspay * TAXRATE;

netpay = grosspay - taxamount;

cout << "EMPLOYEE ID IS " << employeeid << endl;

cout << "THE HOURS WORKED ARE " << hoursworked << endl;

cout << "THE HOURLY RATE IS " << hourlyrate << endl;
cout << "THE GROSSPAY IS " << grosspay << endl;
cout << "THE TAXAMOUNT IS " << taxamount << endl;

cout << "THE NETPAY IS " << netpay << endl;

return 0;


The 3 errors were:
1. Command/Developer/Private/jam failed with exit code 1
2. illegal character: \35

3. 'class'or 'interface' expected

Recommended Answers

All 4 Replies

2. illegal character: \35

You probably have control characters stuck in the code. I think the ?'s in the code you posted mean that the forum can't print them, but that's where they are.

3. 'class'or 'interface' expected

You said Xcode with java tools, does that mean you're trying to compile C++ as java?

If the problem is a control character, I am not sure which character it is and yes, im trying to compile in java

if you could write an easy payroll program on the thread I could get an idea .....only if ya got any time .....I really appreciate the help!

Java doesn't compile C++ code. They're different languages... You need a C++ compiler if you want to compile C++ code.

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.