Hello I am getting a few errors that I cannot get rid of. My program assignment is:
// gets an integer from the user and returns it
int GetInt(void);
// gets a double from the user and returns it
double GetDouble(void);
// gets a letter from the user and returns it
char GetInitial(void);
// takes two arguments, an integer and a double
// adds 10 to the integer and returns the result
//multiplies the double argument by .5 and prints the result onto the screen
int FunctionOne( int arg1, double arg2);
// takes one character argument and returns and integer
//change the letter to uppercase (use ctype.h)
//return a 1 if the letter is in the first half of the alphabet(A-M)
//return a 2 if the letter is in the second half of the alphabet (N-Z)
int FunctionTwo(char arg1);
Main function logic:
declare variables
call GetInt, GetDouble, and GetInitial
pass the inputs to FunctionOne and FunctionTwo
print the integer with the 10 added to it
print a 1 or a 2 based on the initial that was entered
Code:
//Jason Swisher
// September 26
// Lab 2
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <ctype.h>//toupper, tolower,
int GetInt(void);
double GetDouble(void);
char GetInitial(void);
int FunctionOne(int Top, double dbl1);
int FunctionTwo(char Rew);
int main()
{
int GetInt(void);
double GetDouble();
char GetInitial();
int FunctionOne(int Top, double dbl1);
int FunctionTwo(char Rew);
return 0;
}
int GetInt(void)
{
int Top;
printf("Pease enter an integer/n");
scanf("%d", &Top);
printf("Your integer is %d /n", Top);
return Top;
}
double GetDouble(void)
{
double dbl1;
printf("Please enter a double/n");
scanf("%lf", &dbl1);
printf("Your double is %f", dbl1);
return dbl1;
}
char GetInital(void)
{
char Rew;
printf("Please enter an intial/n");
scanf(" %c", &Rew);
prinft("Your intial is %c /n", Rew);
return Rew;
}
int FunctionOne(int Top, double dbl1)
{
Top = Top + 10;
printf("Your integer plus 10 is %d/n", Top);
dbl1 = dbl1 / 2;
printf("Your double divided by 2 is %f/n", dbl1);
return Top, dbl1;
}
int FunctionTwo(char Rew)
{
Rew = toupper(Rew);
if(Rew >='M')
{
printf("1");
}
else Rew;
{ printf("2");
}
return 0;
}