main.c 2. Hide and Seek (Integral) by Catherine Arellano #include 2 #include"decimalPos.h" Your friend asked you to write a code that would determine the digit in the integral part given a floating point number and the integral position. For example, the given number is 1234.567, given position is 2(position starts from right to left). So the digit is 3, because position 1 in the integral part is 4, position 2 is 3, position 3 is 2 and position 4 is 1. int main(void) { float num = getNum(); int pos = getPos(); int n = determineNum(num, pos) display(n); return 0; 4 5 7 8 9. You are required to implement the following functions: float getNum(); *asks and returns number from the user."/ int getPos(); *asks and returns integral position*/ int determineNum(float num, int pos); *returns the decimal value at the inputted integral position"/ void display(int n); "display the output*/ You are not allowed to edit main.c and decimalPos.h. Input 1. The number 2. The decimal position Output
main.c 2. Hide and Seek (Integral) by Catherine Arellano #include 2 #include"decimalPos.h" Your friend asked you to write a code that would determine the digit in the integral part given a floating point number and the integral position. For example, the given number is 1234.567, given position is 2(position starts from right to left). So the digit is 3, because position 1 in the integral part is 4, position 2 is 3, position 3 is 2 and position 4 is 1. int main(void) { float num = getNum(); int pos = getPos(); int n = determineNum(num, pos) display(n); return 0; 4 5 7 8 9. You are required to implement the following functions: float getNum(); *asks and returns number from the user."/ int getPos(); *asks and returns integral position*/ int determineNum(float num, int pos); *returns the decimal value at the inputted integral position"/ void display(int n); "display the output*/ You are not allowed to edit main.c and decimalPos.h. Input 1. The number 2. The decimal position Output
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question

Transcribed Image Text:+ Back to Home
Time Left: 44:07
Overall Score: 0
main.c
decimalPos.h
2. Hide and Seek (Integral)
by Catherine Arellano
#include<stdio.h>
Your friend asked you to write a code that would determine the
digit in the integral part given a floating point number and the
integral position. For example, the given number is 1234.567,
given position is 2(position starts from right to left). So the digit
is 3, because position 1 in the integral part is 4, position 2 is 3,
position 3 is 2 and position 4 is 1.
#include"decimalPos.h"
int main(void) {
float num = getNum();
int pos = getPos();
int n =
%3D
determineNum(num, pos);
display(n);
return 0;
}
7
9.
You are required to implement the following functions:
float getNum();
*asks and returns number from the user.*/
int getPos();
*asks and returns integral position*|
int determineNum(float num, int pos);
*returns the decimal value at the inputted integral position*/
void display(int n);
/*display the output*/
You are not allowed to edit main.c and decimalPos.h.
Input
1. The number
2. The decimal position
Output
Score: 0/15
Overvlew
2/3
123 456 8
![Time Left: 43:39
Overall Score: 0/40
Current Rank: 38th
Layout: Side-by-Side
ain.c
decimalmos.h x
< > + c
Test Cases
Executions
float getNum();
/*asks and returns number from the user.*/
CE Run Tests
int getPos();
/ *asks and returns the integral position*/
O Test Case 1
int determineNum(float num, int pos);
/*returns the decimal value at the inputted integral
Your Output
No Output
void display(int n);
1
/ *display the output*/
Expected Output
Enter the number: 1234.567
Enter the integral position: 2
Decimal value at integral position
O Test Case 2
O Test Case 3 Hidden
O Test Case 4 Hidden
O Test Case 5 Hidden
Execute Code (F10]
II](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F433a2989-ade8-4545-857b-be121ae7049f%2Fc5cd2d4c-a403-448b-b5a0-6a3a46a7f0ba%2Fadu3zs2_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Time Left: 43:39
Overall Score: 0/40
Current Rank: 38th
Layout: Side-by-Side
ain.c
decimalmos.h x
< > + c
Test Cases
Executions
float getNum();
/*asks and returns number from the user.*/
CE Run Tests
int getPos();
/ *asks and returns the integral position*/
O Test Case 1
int determineNum(float num, int pos);
/*returns the decimal value at the inputted integral
Your Output
No Output
void display(int n);
1
/ *display the output*/
Expected Output
Enter the number: 1234.567
Enter the integral position: 2
Decimal value at integral position
O Test Case 2
O Test Case 3 Hidden
O Test Case 4 Hidden
O Test Case 5 Hidden
Execute Code (F10]
II
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY