Help me programming gods!

Published Nov 17, 2017

Wrote a simple Program in C and can't wrap my head around why it doesn't work!
// test.cpp : Defines the entry point for the console application.
//

include "stdafx.h"

include <stdio.h>

include <time.h>

include <conio.h>

include <math.h>

include <stdlib.h>

include <string.h>

include <cctype>

include <cstdio>

pragma warning (disable: 4996)

char name[10][80];
char phone[10][20];
float hours[10];
float wage[10];

int menu();
void enter(), report();

int main()
{
	int choice=0;
	do 
	{
		int choice = menu();
		switch (choice)
		{
		case 0: break;
		case 1: enter();
			break;
		case 2: report();
			break;
		default: printf("Try again.\n\n");			
		}

	} while (choice!=0);
	return 0;
}

int menu()
{
	int choice=0;
	printf("0. Quit\n");
	printf("1.Enter Information\n");
	printf("2.Enter Information\n");
	printf("\nChoose one: ");
	scanf("%i", choice);

	return choice;
}

void enter()
{
	int i;
	char temp[80];
	for (i = 0; i < 10; i++)
	{
		printf("Enter last name: ");
		scanf("%s", name[i]);
		printf("Enter phone number: ");
		scanf("%s", phone[i]);
		printf("Enter number of hours worked: ");
		scanf("%s", hours[i]);
		printf("Enter wage: ");
		scanf("%s", wage[i]);
	
	}
}

void report()
{
	
	int i;
	for (i = 0; i < 10; i++)
	{
		double wh = hours[i] * wage[i];

		printf("%s %s\n", name[i], phone[i]);
		printf("Pay for the week: %s\n", wh);
	}
}
Discover and read more posts from Mystic Pyro91
get started
Enjoy this post?

Leave a like and comment for Mystic