the project to be done(the question)
the error am getting while running my constructed project
kindly help me to correct the error
the above picture are of my constructed project related to the question i uploaded please use C programming(c blocks), take pictures of how the error was corrected so that i will successful run my project .
thank you you will be rated higher and i will command my friend to rate u higher
good luck .
this is the clear picture of error am getting while running my project
#include <stdio.h> #include <math.h> float calculatecubevolume float side): void volumerectularprism float float, float) ; float calculatespherevolume (float ): int main (void) int selection: float side; do printf("1.Cube\n"); printf("2. Rectangular prism\n"); printf("3.sphere\n"); printf("4.finish\n"); printf("Enter your selection (1,2,3,4): "); scanf "%d", &selection); switch (selection) ease
case 1:{ I { float volume; printf("Enter the side length of the cube :"); scanf ("3f", &side) ; volume=calculate cubevolume (side) ; printf("volume of cube i3 %.2f with side length of $.2f\n" volume, side) ; float calculatecubevolume (float side) float volume= pow (side, 9); return volume, break; case 2
case 2:1 (float a,b,c: float volume: printf ("Enter 3 side lengths :"); scanf ("sf sf $f", 4a, b, ): volumerectularprism (a,b,c); | void volumerectularprism( float width float heigth, float length) float volume volume=width heigth length: printf("the volume of rectangular prism is return; $.2f", volume) : break; case
case 3: float volume radius: printf("Enter the circle, radius:").- scanf in sferadius volume = calculatespherevolume radius); printf(volume of sphere is $.2f with radius length of $.2f\n" , volume, radius) : float calculatespherevolume (float radius) float PILYALUE- float ab-BIE float volume (a/b) PI_VALUE return volumes pow (radius, s); I break
case 4:printf ("\n you selected to finish the program\n"); break; default:printf("\n invalid choice \n"); } while (selection =4) - I return 0;
Term Project, Spring 2021-2022 Term Project Write a C program to calculate the volumes of the cube, rectangular prism, and sphere. In the program, one side length for the cube, three side lengths for the rectangular prism, and the radius length for the sphere are taken as inputs in centimeters. The user chooses which object he/she wants to find the volume of from the menu given to him/her. The volume calculation process continues until the user selects the finish option. In addition, separate functions must be used to calculate the volume of each object in the program. The features of these functions are: Cube: This function takes the side length of the cube object as a parameter and returns its volume as a function value. Rectangular prism: This function takes the length of three sides of the rectangular prism object as a parameter and prints its volume within the same function. D na Sphere: This function takes the radius of the sphere object as a parameter and returns its volume as a function value. Sample Output: 1. Cube 2. Rectangular prism - whL 3. Sphere 3 4. Finish V=43 Enter your selection (1,2,3,4): 2 Enter the three side lengths of the rectangular prism: 4.0 5.0 10.0 Volume = 200.00 1. Cube 2. Rectangular prism 3. Sphere 4. Finish Enter your selection (1,2,3,4): 4
Logs & others 2 Code::Blocks X Search results X Cocc X Build log X Build messages X CppCheck/Vera++ X CppCheck/Vera+ + messages X Eile Message C:\Users\Jassa\Desktop\final\combined\main.c C:\Users\Jassa \Desktop\final combined main.c 46 C:\Users\Jassa \Desktop\final combined main.c C:\Users\Jassa \Desktop\final (combined\main.c C:\Users\Jassa \Desktop\finall combined main.c obj\Debug\main.o C:\Users\Jassa\Desktop\final combined main.c C:\Users\Jassa\Desktop\final\combined main.c C:NUsers Jassa\Desktop\final\combined main.c 76 Build: Debug in combined (compiler: GNU GCC Compiler) In function main": Tarning: unused variable 'volume' [-Wunused-variable) warning: 'calculatespherevolume' defined but not used [-Wunused-function] warning: 'volumerectularprism' defined but not used t-Tunused-function] arning: 'calculatecubevolume' defined but not used [-Funused-function] 35 In function main : unde Eined reference to calculatecabezolue! undefined reference to volumerectularprism' undefined reference to calculatespherevolume error. 1d returned 1 exit status === Build failed: 4 error(s), 4 warning(s) (0 minute (s), 1 second(s))
Build log X Build messages X CppCheck/Vera++ X CppCheck/Vera++ messages Message = Build: Debug in combined (compiler: GNU GCC Compiler) In function 'main': warning: unused variable 'volume! [-Wunused-variable) varning: 'calculatespherevolume' defined but not used t-Funused-function) varning: 'volumereotularprism defined but not used [-Tunused-function] Yarning: 'calculatecubevolume" defined but not used [-Nunused-function] -c 79 53 F c 35 In function main. undefined reference to calculatecubevolume! undefined reference to volumerectularprism undefined reference to calculatespherevolume LC ein 10 returned 1 exit status Build failed: 4 error (s), 4 warning (s) (0 minute (s), 1 second(s) ) ===
#include #include float calculatecubevolume float side): void volumerectularprism float float, float)
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
#include #include float calculatecubevolume float side): void volumerectularprism float float, float)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!