Question

C programming. please include comments

In this lab, you will learn to read data from and write data to a file - another use for pointers. SAMPLE PROGRAM There are tIn the function, you should standardize the style of the letters, capitalizing the first letter of each name, and making allOutput: nput: formatted Names. - X inputData Names....- File Edit Format View Help File Edit Format View Help eDwarD munChin

0 0
Add a comment Improve this question Transcribed image text
Answer #1
  1. #include <stdio.h>

  2. int main ()

  3. {

  4. int c = 0;

  5. char ch, s[1000];

  6. printf("Input a string\n");

  7. gets(s);

  8. while (s[c] != '\0') {

  9. ch = s[c];

  10.   if (ch >= 'A' && ch <= 'Z')

  11. s[c] = s[c] + 32;

  12.   else if (ch >= 'a' && ch <= 'z')

  13. s[c] = s[c] - 32;  

  14. c++;  

  15. }

  16. printf("%s\n", s);

  17. return 0;

  18. }

Add a comment
Know the answer?
Add Answer to:
C programming. please include comments In this lab, you will learn to read data from and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ I need a program that will read a list of names from a data file and store them in an array. You will then sort the array by last name using a quicksort, and display the results, one name per line...

    C++ I need a program that will read a list of names from a data file and store them in an array. You will then sort the array by last name using a quicksort, and display the results, one name per line.Each line has a first name and a last name.The file has 40 names in it right now, but the array should be able to accommodate up to 50 names.txt***************************************************** Barbara Wright Ian Chesterton Steven Taylor Sara Kingdom Dodo...

  • Language: C++ (Please show output) Part 1 - LIST Create an unsorted LIST class. Each list...

    Language: C++ (Please show output) Part 1 - LIST Create an unsorted LIST class. Each list should be able to store 100 names. Part 2 - Create a Class ArrayListClass It will contain an array of 27 "list" classes. Next, create a Class in which is composed a array of 27 list classes. Ignore index 0... Indexes 1...26 correspond to the first letter of a Last name. Again - ignore index 0. index 1 is names starting with A, index...

  • //Done in C please! //Any help appreciated! Write two programs to write and read from file...

    //Done in C please! //Any help appreciated! Write two programs to write and read from file the age and first and last names of people. The programs should work as follows: 1. The first program reads strings containing first and last names and saves them in a text file (this should be done with the fprintf function). The program should take the name of the file as a command line argument. The loop ends when the user enters 0, the...

  • Problem 2. Write a program that reads in the file names.txt from data\ on the flashdrive...

    Problem 2. Write a program that reads in the file names.txt from data\ on the flashdrive and counts all of the unique first names in the file. Find the name that occurs the most. a. Note: you will want to import the filename as args[0] to avoid hardcoding the filename. If you have the exact number of elements in your array as your data (read it in a method) returning the Array. then you can use Arrays.sort(myArray) to sort the...

  • Write a C++ code to make a simple program that imports the input file in and...

    Write a C++ code to make a simple program that imports the input file in and gets the results as specified Please follow the instructions and paste the code below as the answer with a screenshot of the output to prove it worked. Input file -> https://www.dropbox.com/s/444jofkchu6ylwr/names.txt?dl=0 Scoring Names You will be using the provided names.txt file, text file containing over five-thousand first names, and you will calculate a score for each name. Begin by reading the names from the...

  • Write a complete C++ program that reads students names and their test scores from an input...

    Write a complete C++ program that reads students names and their test scores from an input text file. The program should output each student’s name followed by the test scores and the relevant grade in an output text file. It should also find and display on screen the highest/lowest test score and the name of the students having the highest/lowest test score, average and variance of all test scores. Student data obtained from the input text file should be stored...

  • Need C programming help. I've started to work on the program, however I struggle when using...

    Need C programming help. I've started to work on the program, however I struggle when using files and pointers. Any help is appreciated as I am having a hard time comleting this code. #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_LINE 100 #define MAX_NAME 30 int countLinesInFile(FILE* fPtr); int findPlayerByName(char** names, char* target, int size); int findMVP(int* goals, int* assists, int size); void printPlayers(int* goals, int* assists, char** names, int size); void allocateMemory(int** goals, int** assists, char*** names, int size);...

  • C++ Programming

    PROGRAM DESCRIPTIONIn this project, you have to write a C++ program to keep track of grades of students using structures and files.You are provided a data file named student.dat. Open the file to view it. Keep a backup of this file all the time since you will be editing this file in the program and may lose the content.The file has multiple rows—each row represents a student. The data items are in order: last name, first name including any middle...

  • please read directions first. this is supposed to be a hybrid programe add comments please JAVA...

    please read directions first. this is supposed to be a hybrid programe add comments please JAVA please add comments Programming Project 1 and Programming Project 2 "Hybrid" Your goal is to write a program that combines the functionality of both Programming Project 1andProgramming Project 2 into a single program. That is, your program should read a file ( Numbers.txt) of numbers of type double that contains some duplicates and is ordered smallest to largest. Your program should ignore the duplicate...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT