EBK DATA STRUCTURES AND ALGORITHMS IN C
4th Edition
ISBN: 9781285415017
Author: DROZDEK
Publisher: YUZU
expand_more
expand_more
format_list_bulleted
Question
Chapter 1, Problem 3PA
Program Plan Intro
Concordance of words
Program plan:
- Define a function named “lget_line()” that adds concordance present on a line using a
vector . - Define a function named “lfind_next()” that finds next word present in sequence.
- Declare a function named “lget_first()” that would retrieve a line’s first word.
- Define a function named “lcheck_context()” that takes two objects “obj1” and “obj2” and checks whether they are adjacent words, “obj1” should be lower.
- Define the function “lset_word()” to check whether multiple word exists in one concordance.
- Define the function “lIs_word()” that would determine if string has word that depends on “*” character.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write a program that reads two integers as input, and outputs the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. Answer in Coral Language
Ex: If the input is:
-15 30
the output is:
-15 -5 5 15 25
Ex: If the second integer is less than the first as in:
20 5
the output is:
Second integer can't be less than the first.
For coding simplicity, output a space after every integer, including the last.
Write a program that deals a number of cards (their numerical values) to a player's hand. To begin, the program asks the player for the values of the deck of cards.
Then, the program deals the first two cards of the deck to a player's hand, and asks him if he wants another card. If he does not want a card, the program ends. If he wants a card, the program deals the next available card in the deck, adds it to the player's hand, and asks the player if he wants another card. The dealing process repeats as long as the user continues to accept cards, or until the cards in the deck run out.
Card dealing involves copying the available card from the deck vector to another vector, which stores the player's hand, at the next available position.
Assume that the deck of cards consists of only 10 cards with numerical values from 1 to 10, which the player will enter by keyboard before the program deals.
The following functions must be implemented/used:
enterDeckValues. - This…
Write a program in Java that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first six letters of the first name, followed by the first letter of the last name, an underscore (_), and then the last digit of the number (use the % operator). If the first name has less than six letters, then use all letters of the first name.
Ex: If the input is:
Michael Jordan 1991
the output is:
Your login name: MichaeJ_1
Ex: If the input is:
Nicole Smith 2024
the output is:
Your login name: NicoleS_4
Chapter 1 Solutions
EBK DATA STRUCTURES AND ALGORITHMS IN C
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- write a program that displays, in ascending order,the first names of those students who have attended more than one day of the course.If there are students with the same first name, display their first and last names.arrow_forwardWrite a program which reads the number of blocks the builders have,and outputs the height of the pyramids that can be built using these blocks.arrow_forwardWrite a program that asks users when their birthday is. Use information provided to give them their astrological sign. Each of the twelve signs should display a different horoscope. Use the following dates for each sign, keeping in mind that both month and day must be evaluated for an accurate result. Aries: March 21–April 20 Taurus: April 21–May 21 Gemini: May 22–June 21 Cancer: June 22–July 22 Leo: July 23–August 22 Virgo: August 23–September 23 Libra: September 24–October 23 Scorpio: October 24–November 22 Sagittarius: November 23–December 21 Capricorn: December 22–January 20 Aquarius: January 21–February 19 Pisces: February 20–March 20arrow_forward
- Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D, and E, possibly followed by + or -. Their numeric values are 4, 3, 2, 1, and 0. There is no F+ or F-. A + increases the numeric value by O.3, a – decreases it by 0.3. However, an A+ has value 4.0. Enter a letter grade: B- The numeric value is 2.7.arrow_forwardSolve in Python: Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first five letters of the last name, followed by the first letter of the first name, and then the last two digits of the number (use the % operator). If the last name has less than five letters, then use all letters of the last name. Ex: If the input is: Michael Jordan 1991 the output is: Your login name: JordaM91 Ex: If the input is: Kanye West 2024 the output is: Your login name: WestK24arrow_forwardWrite a program that determines an integer value the user had in mind. Your program first asks the user to enter the lower and upper bounds of the range that the integer belongs to, and then presents a series of questions “Is the number greater than x?” with yes/no answers to the user in order to determine the integer value that the user had in mind. For instance, if the integer in mind is 5 and the interaction between the user and your program is: Please enter the lower bound: -10 Please enter the upper bound: 50 Is the number greater than 20 (Y/N)? n Is the number greater than 4 (Y/N)? y Is the number greater than 12 (Y/N)? n Is the number greater than 8 (Y/N)? n Is the number greater than 6 (Y/N)? n Is the number greater than 5 (Y/N)? n Your program should then print: The number you had in mind is 5 Your program should ask roughly log2(upper_bound − lower_bound) questions. Your program A3_1.py should include a main() function and may include other functions that you prefer.…arrow_forward
- Write a program that can suggest an activity based on the temperature. If the temperature is between 20 to 40 degrees Fahrenheit, suggest the user go skiing; if the temperature is between 41 to 60 degrees Fahrenheit, suggest the user go hiking; if the temperature is in the range of 61 to 80, suggest swimming. For all the temperatures out of these ranges (too cold or too hot), then suggest staying inside.arrow_forwardWrite a program that computes the rent in five years and the total rent for one year starting five years from nowarrow_forwardWrite a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. Ex: If the input is -15 30, the output is: -15 -5 5 15 25 Ex: If the second integer is less than the first as in 20 5, the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last.arrow_forward
- Write a program that simulates a simple calculator. It reads two integers and a character. If the character is a ‘+’, the sum is printed; if it is a ‘-’, the difference is printed; if it is a ‘*’, the product is printed; if it is a ‘/’, the quotient is printed; and if it is a ‘%’, the remainder is printed. (Refrance C++)arrow_forwardWrite a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles per gallon theautomobile can be driven without refueling.arrow_forwardWrite a program that receives a number from a user and checks if it's float or integer.In case of being float, print for the user that his/her number is float with integer part andfractional part. In case of being integer, print to the user that his/her number is aninteger and odd/even numbeRarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY