Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programs must br written in C and please follow the instructions and match the sample output. Project 5, Program Design 1. (60 points) A hashtag

Programs must br written in C and please follow the instructions and match the sample output. image text in transcribed
image text in transcribed
Project 5, Program Design 1. (60 points) A hashtag is a word or phrase preceded by a hash sign used on social media websites and applications, especially Twitter, todentify messages on a specific topic, Hashtag ends at an invalid hashtag character any character that is not a letter, digit, or underscore) or the end of the sentence. Write a program to check ifa sentence entered by user contains a hashtag. If so, display the hashtag If not, ita no hashtag message. If there are multiple hashtags in the input, display the first one Example input/output: Input: Input: More than 10 students messaged us to win an exelusive pair of US Seks last week for national Soekbay Output Nationalsockay Input: More than 130 students Sessed us to win an exelusive pair of USE Socks last week for NationalsockDay! Output: No hashtag in the input Input: More than 130 Stunts to win an exclusive pair of HUSE Seks last week for at inal Sac Day! Output: USE to win an exelusive Input: More than 130 studentend pair of USF socks last week forations Output. National SockDay Your program should include the following function: int find_hashtag char *sl. char *52) The find hashtag function expects si to point to a string containing the input as a string and stores the hashtag to the string pointed by 32. the input does not contain a hashtag 52 should contain an empty string. An empty string is a valid string with no characters except the null character. The function returns the input contains a hashtag, and returns otherwise, 1) Name your program extract hashtag.c. 2) Assume input is no longer than 1000 characters 3) The End hashtag function should use pointer arithmetic instead of array subscriptingl. In other words, eliminate the loop Index arts and use of the operator in the function 4) strtok and strtok functions are not allowed in this program 5) Library function isalphall, digt, and sam are allowed in this program 6) To read a line of text, use the read_line function (the pointer version) in the lecture notes 2. (40 points) Write a program that accepts as command line arguments the sign of a math operation (+,- x, or /) and two integer numbers and displays the result of the operation (all integer operations). For example, if the arguments are +, 5, -3, the program should display 2. You may find strcmp function useful. Note: x for the multiplication is letter x, not * (* has special meaning to Unix shell.) Sample run: ./a.out - 52 output: 3 1) Name your program command_math.c. 2) Use atoi function in to convert a string to integer form

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

Step: 3

blur-text-image

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions