TECH 104 Programming Fundamentals - C Programming Assignment

Assignment Help C/C++ Programming
Reference no: EM132460764

TECH 104 Programming Fundamentals - C Programming Assignment, Humber College, Canada

Lab - Strings

Write a program that finds the "smallest" and "largest" in a series of words. After the user enters the words, the program will determine which words would come first and last if the words were listed in dictionary order. The program must stop accepting input when the user enters a four-lettered word.

1) Use two strings named smallest_word and largest_word to keep track of the "smallest" and "largest" words entered so far. Assume that no word is more than 20 letters long.

2) Use a third string with a name current_word. The current_word will store every word entered by the user.

3) Prompt the user to enter a word.

4) Use a read_line function from slide 13 of lesson 10 to get the string from the user (Pass current_word and its size to read_line. Convert return type of read_line to void)

5) In your main program, use strcpy function to copy current_word into smallest_word and largest_word, respectively.

6) Use strlen for condition of while loop to determine when the user has entered a four-letter word.

Inside while loop

7) Prompt the user again to enter a word.

8) Call read_line function.

9) Use an if statement with condition using strcmp to compare current_word with smallest_word; if the new word is "smaller", use strcpy to save it in smallest_word.

10) Use an if statement with condition using strcmp to compare current_word with largest_word; if the new word is "larger", use strcpy to save it in largest_word.

1266_figure.png

Note that if you #include <stdlib.h> you can use system("pause"); and system("cls"); to pause your program or clear the screen.

In a word document provide a cut and paste of your .c code as well as an image of your program output for one menu option. Submit your word document through blackboard. Remember to include <string.h>.

Reference no: EM132460764

Questions Cloud

Derive the algebraic equation for the isorevenue line : Derive the algebraic equation for the isorevenue line. Explain the significance of the intercept and the slope of the isorevenue line
Decision rule for choosing the optimal combination of output : Explain why this must be true. Explain the decision rule for choosing the optimal combination of output that maximizes profit.
Write about the army leadership argumentative paper : Why you think that particular aspect of leadership is the most important, with respect to the duty positions and responsibilities of a Captain in the U.S. Army
What is the optimal level of production of wine decanters : What is the optimal level of production of wine decanters? What the marginal revenue of the last decanter sold.
TECH 104 Programming Fundamentals - C Programming Assignment : TECH 104 Programming Fundamentals - C Programming Assignment Help and Solution, Humber College, Canada. Write program that finds smallest series of words
Rate of new-product development in countries : What factors affect the rate of new-product development in countries?
COU103A Human development across the life span Assignment : COU103A Human development across the life span Assignment Help and Solution, Torrens University - Assessment Writing Service - Developmental period.
Uniform pricing-3rd degree price discrimination : If the fixed cost is 150,000 per month, marginal cost is 50.00, price is 50.00, Qd is 14,455 what is the formula to calculate the profits and what is the profit
Discuss role of discretion in decision made by public safety : Discuss the role of discretion in decisions made by public safety,Discuss the importance of decision-making as a skill for public safety leaders.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write program to do some of the heavy lifting

Your program should accept as input the amount of income made by the user in the past year, the marital status of the user

  Write a c matrix multiplication program which you can

write a c matrix multiplication program which you can instrument to monitor and measure execution time as a function of

  Write a cpp program to implement a queue using linked lists

Write a C++ program to implement a queue using linked lists. The program should provide the following functionality: Print the number of elements in the queue.

  Main function to input twenty integers in given range

Write a main function to input 20 integers in range of 1-6, function should count number of times the numbers 2 and 5 occur. function must declare statics variables count2 and count5.

  Assignment 1write a program using vectors and iterators

assignment 1write a program using vectors and iterators that allows a user to maintain a personal list of dvd titles.

  Create a program that displays the number of days in a month

Create a program that displays the number of days in a month. Use a 12-element one-dimensional array to store the number of days in each month (use 28 for the number of days in February).

  T computes and posters the probabilities of two people

Write a C program that computes and posters the probabilities of two people in a group who are born in the same day. The probability of two people being born in the same day of the year, for a group of  n people, is given by the following formula:

  Define an int function that takes six parameters

Define an int function that takes 6 parameters. 2 of them, a and b are of type int- 4 other parameters are pointers to int.

  Write an oop program to store integers into a linked list

Write an OOP program to store integers into a linked list. Add code so that the linked list sorted.

  Optimize the preceding code for kathy

Optimize the preceding code for Kathy and find out the errors (if any). What would be the output of the preceding code, if the first number is 46 while the second number is 37?

  What is a pure virtual function

What is a pure virtual function in C++? Why does a class that contains a pure virtual function must be an abstract class?

  Computes the area of a rectangle

Create an object oriented application with C# that computes the area of a rectangle, and the area and the volume of a cuboid.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd