#include <stdio.h>
int main ()
{
char fName[12];
char lName[12];
float payRate[12];
float hours[12];
float salary[12];
int empNbr;
Type: Posts; User: time4f5
#include <stdio.h>
int main ()
{
char fName[12];
char lName[12];
float payRate[12];
float hours[12];
float salary[12];
int empNbr;
any thoughts on why this program is only asking for inputs on the name arrays and skips the floats?
you are closing your else statement with ; ..... you don't want to do that. Also, if statements don't get ; on their line either.
6 lines from the bottom you use "if (num%2==0)
I guess I am wrong. thanks for the heads up. I always assumed that I had to include certain libraries math.h if I wanted to do math functions and not give all of the instructions.
ahh, good catch, I changed it to a string but it didn't fix my problem. Also, I fixed the printf on the display portion \t %s \t %s instead of \t fName[b].
it asks for the number of employees and I can enter it.
it then asks for the first name, I enter it
it asks for the last name and when I enter it, it prints "what is payrate, what is hours, what is...
in C the .h is a header file that is includes a library. a library is a 'set of instructions' for the program to run. This way you don't have to tell the program everything. It knows what an...
it compiles, it asks for the first name, last name and prints the next 3 lines and then asks for the first name again.
I have this assignment that I thought would be super easy, but for some reason I can't get it to work, can you give me some insight?
#include <stdio.h>
int main ()
{
char fName[12];
char...
I will do that, thanks for the help. because I haven't used it before, I wasn't sure if I was screwing something up or something wasn't there. lol
Hello, I have downloaded mingw, I'm playing with it to try and learn it from command line, but it is nothing like Visual studio 10 PE- which is why I want to learn it. anyway, I'm trying to compile...
thanks, the mobile display is much better now.
o.k. thanks!
my textbook encourages us to use using namespace std; after our libriaries. On this forum I'm noticing that some do not. I'm trying to understand what is the reason to use it or not use it, other...
http://cboard.cprogramming.com/c-programming/136019-output-screen-isnt-giving-proper-result.html
here is a question that I had posted earlier. It may be helpful.
It isnt meant to replace docs and books. But for someone who doesnt have a helpful teacher it can give some basic help.
which class are you in? and what school?
sometimes it may be helpful to checkout newboston on youtube. he has some introductory videos on programming in C and other languages. If you check out the first few videos you should be able to...
I had thought about that. I'll have to add that.
Awesome! it worked Salem. I had to change the variable. Here is my updated code
int assignFleet1(int board1 [] [10])
{
int car1, coordinate, location;
int row, col;
int carrier1;
I began writing this battleship code today and as I'm working on it, I'm finding that I have a function that could be more efficient(understatment). I'm just not sure how. The code compiles and...
keep some perspective, you're not finalizing anything other than the pseudocode. use your book to get the proper syntax of your statements. most lines end in ;
you are missing a few libraries
time.h
stdlib.h
and you should put a return 0; statement in there
I can't figure this code out but I'm now inspired to try one on my own.