Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, Please help me answer the questions below using the C programming language. The first file is the only file that needs to be edited

Hello,

Please help me answer the questions below using the C programming language. The first file is the only file that needs to be edited and the second file performs various tests. The description of what each function must do is self-explanatory based on the name of the function.

Thank you!!

FILE #1

#include

//1

void scan_2(int *i, char *c) {

}

void print_2(int i, char c) {

}

//2

int pow_xy(int *xptr, int y) {

return result;

}

//3

int convert_temp(int degree, char scale, int *other_degree, char *other_scale) {

return 0;

}

//4

int init_array(int array[ ], int len, int start_value) {

return 0;

}

//5

void reverse_numbers(int nums[], int len) {

}

TEST FILE #2

#include

#include "FILE1.c"

void test_p1() {

printf(" p1 ");

int integer;

char character;

printf("type an int and a char (no blanks) ");

scan_2(&integer, &character);

print_2(integer, character);

}

void test_p2() {

printf(" p2 ");

int x = 2;

int *xptr = &x;

printf("pow_xy %d 3 ", x);

pow_xy(xptr, 3);

printf("= %d ", x);

}

void test_p3() {

printf(" p3 ");

int new_degrees;

char new_scale;

convert_temp(32, 'F', &new_degrees, &new_scale);

printf("32 F is %d %c ", new_degrees, new_scale);

convert_temp(10, 'C', &new_degrees, &new_scale);

printf("10 C is %d %c ", new_degrees, new_scale);

}

void test_p4() {

printf(" p4 ");

int numbers[5];

init_array(numbers, 5, 2);

int i;

for (i=0; i<5; i++)

printf("%d ", numbers[i]);

printf(" ");

}

void test_p5() {

printf(" p5 ");

int phone[] = {3, 1, 2, 3, 6, 2, 6, 1, 0, 6};

reverse_numbers(phone, 10);

int i;

for (i=0; i<10; i++)

printf("%d ", phone[i]);

printf(" ");

}

int main() {

test_p1();

test_p2();

test_p3();

test_p4();

test_p5();

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

13-1 How does building new systems produce organizational change?

Answered: 1 week ago