2023 Write a function called convert weight This function should convert between pounds and kilograms and vice versa Here is | Assignment Collections

Computer Science 2023 Write a function called

2023 Write a function called convert weight This function should convert between pounds and kilograms and vice versa Here is | Assignment Collections

Write a function called convert_weight. This function should convert between pounds and kilograms, and vice versa. Here is the prototype for this function:

 

 

void convert_weight(int, char[], int*, char[]);

 

There are 2.2 pounds per kilogram.

 

The second and forth parameters are strings, which specify the units (“lbs” or “kgs”). An example call to this function is:

 

 

#include <stdio.h>

 

 

int main() {

 

char newline, another = ‘y’;

 

int weight1, weight2;

 

char units1[4], units2[4]; // length 4 because of ‘’

 

while (another == ‘y’) {

 

printf(“Enter a weight and the units of the weight (lbs or kgs)n”);

 

scanf(“%d %s”, &weight1, units1);

 

convert_weight(weight1, units1, &weight2, units2);

 

printf(“%d %s = %d %snAnother (y or n)n”, weight1, units1, weight2, units2);

 

scanf(“%c%c”, &newline, &another) ;

 

}

 

return 0;

 

 

}

 

 

 

Write a function called strcat373, which concatenates two strings in precisely the same way that strcat does from the C library <string.h>. The concatened string is constructed in the array string1; a pointer to the beginning of this array is also returned. string2 should not be affected by this function. Please use “array syntax” in strcat373; that is, the parameters as well as the local variables should not use the explicit pointer declaration (using the * symbol), with the exception of the value that is returned by this function. Instead, you should used the [ ] operator. You may not use any of the built-in C string library functions to complete this code.

 

Here is the prototype of this function:

 

char *strcat373(char string1[ ], char string2[ ]);

 

And here is a main function which calls strcat373.

 

 

int main() {

 

char str1[81], str2[81];

 

char again = ‘y’, newline;

 

while (again == ‘y’) {

 

printf(“Enter a stringn”);

 

scanf(“%s”, str1);

 

printf(“Enter another stringn”);

 

scanf(“%s”, str2);

 

printf(“The concatention is %sn”, strcat373(str1, str2));

 

printf(“Second test: The concatenation is %sn”, str1);

 

printf(“The second string is still %sn”, str2);

 

printf(“Again? (y/n)n”);

 

scanf(“%c%c”, &newline, &again);

 

}

 

 

}

 

 

 

Write a function called strcmp373, which compares two strings in precisely the same way that strcmp does in the C library <string.h>. Please be sure that you emulate the strcmp C function. Note that strcmp returns 0 if the two strings are equal, even though 0 normally means false in C. This time, please use “pointer syntax” in writing this function. That is, the [ ] operator should not be used at all when referring to particular characters in string1 and string2; instead, all parameters and local variables should be declared as pointers (using the * symbol). You may not use any of the built-in C string library functions to complete this code.

 

Here is the prototype of this function:

 

int strcmp373(char *string1, char *string2);

 

And here is a main function which you can use to test strcmp373.

 

 

int main() {

 

char str1[81], str2[81];

 

char again = ‘y’, newline;

 

while (again == ‘y’) {

 

printf(“Enter a stringn”);

 

scanf(“%s”, str1);

 

printf(“Enter another stringn”);

 

scanf(“%s”, str2);

 

int comp = strcmp373(str1, str2);

 

if (comp < 0)

 

printf(“%s is alphabetically before %sn”, str1, str2);

 

else if (comp > 0)

 

printf(“%s is alphabetically after %sn”, str1, str2);

 

else printf(“%s and %s are the samen”, str1, str2);

 

printf(“Again? (y/n)n”);

 

scanf(“%c%c”, &newline, &again);

 

}

 

}

 

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational