SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 231 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 15 Nov 2017 My Price 10.00

("Enter 1 to calculate Square, 2 to Calculate Cube, 3 to Shrink n: ");

#include <stdio.h>

 

int main ()

{

/* variable definition: */

int intValue, menuSelect,Results;

double dblValue, dblResults;

intValue = 1;

// While a positive number

while (intValue > 0)

{

printf ("Enter a positive Integern: ");

scanf("%d", &intValue);

if (intValue > 0)

{

dblValue = intValue;

printf ("Enter 1 to calculate Square, 2 to Calculate Cube, 3 to Shrink n: ");

scanf("%d", &menuSelect);

if (menuSelect == 1)

{

// Call the Square Function

Results = Square(intValue);

printf("Square of %d is %dn",intValue,Results);

}

else if (menuSelect == 2)

{

// Call the Cube function

Results = Cube(intValue);

printf("Cube of %d is %dn",intValue,Results);

}

else if (menuSelect == 3)

{

// Call the Shrink function

dblResults = Shrink(dblValue);

printf("Shrink of %d is %fn",intValue,dblResults);

}

else

printf("Invalid menu item, only 1, 2 or 3 is acceptedn");

}

}

return 0;

}

/* function returning the Square of a number */

int Square(int value)

{ return value*value;

}

/* function returning the Cube of a number */

int Cube(int value)

{ return value*value*value;

}

// function returning the Shrink of a number

double Shrink(double value)

{ return value/2;

}

 

 

I got the above code from a pdf from this site and it works great in the pictures, but won't run even when i copy and paste it over. I have attached the errors I'm getting from the Ideone.com site so you can help me fix it. I want to understand what is happening, not just be given the right answers.Failure.png

Attachments:

Answers

(5)
Status NEW Posted 15 Nov 2017 01:11 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)