1) Write a program in C that stores a list of employee records in an array of structs. Each employee record should contain the following fields: Name (string), Age (int), Salary (float), Department (string). The program should prompt the user to enter the name of an employee, and then search the array of employee records for an employee with a matching name. If a matching employee is found, the program should print out the employee's age, salary, and department. If no matching employee is found, the program should print an error message. The program should use a linear search algorithm to find a matching employee in the array. If the employee's age is greater than 50, their salary should be multiplied by 1.1. If the employee's age is less than or equal to 50, their salary should be divided by 1.2.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
1) Write a program in C that stores a list of employee records in an array of structs. Each
employee record should contain the following fields: Name (string), Age (int), Salary
(float), Department (string). The program should prompt the user to enter the name of an
employee, and then search the array of employee records for an employee with a matching
name. If a matching employee is found, the program should print out the employee's age,
salary, and department. If no matching employee is found, the program should print an
error message. The program should use a linear search algorithm to find a matching
employee in the array. If the employee's age is greater than 50, their salary should be
multiplied by 1.1. If the employee's age is less than or equal to 50, their salary should be
divided by 1.2.
2) Write a C program that defines a function called 'multiply_by_two' that takes an integer as
an argument and returns the result of multiplying it by 2. The main function of the program
should prompt the user to enter integer, call the 'multiply_by_two' function with the
user-entered integer as an argument, and then print out the result returned by the function.
In addition to the basic functionality described above, the program should also have the
following features:The program should continue to prompt the user for integers and
perform the multiplication until the user enters a negative number.
3) The program should keep track of the total number of multiplications performed and the
total sum of all the results, and should print out these values after the user has entered a
negative number.
The program should define a second function called 'is_even' that takes an integer as an
argument and returns 1 if the number is even, and 0 if the number is odd. The
'multiply_by_two' function should use the 'is_even' function to determine whether the input
number is even or odd, and should only perform the multiplication if the input number is
even. If the input number is odd, the 'multiply_by_two' function should return 0 without
performing the multiplication.
For example, if the user enters the following integers: 5, 4, -3, 6, the program should output:
Number of multiplications: 2
Total sum of results: 32
4) Write a C program that reads in a string from the user, removes all vowels from the string,
and then prints the modified string. The program should be case-insensitive, so it should
remove both uppercase and lowercase vowels. For example, if the user enters the string
'Hello World!', the program should print out 'HII Wrd!'. If the user enters the string 'This is a
test', the program should print out 'Ths s tst'."
5) Write a C program that reads in a string from the user and determines whether the string is
a palindrome (i.e., a word that is spelled the same forwards and backwards). The program
should ignore spaces and punctuation, and should be case-insensitive. For example, the
strings 'racecar', 'A man a plan a canal Panama', and 'radar' should all be considered
palindromes by the program. The strings 'hello', 'world', and 'This is not a palindrome'
should not be considered palindromes
Transcribed Image Text:1) Write a program in C that stores a list of employee records in an array of structs. Each employee record should contain the following fields: Name (string), Age (int), Salary (float), Department (string). The program should prompt the user to enter the name of an employee, and then search the array of employee records for an employee with a matching name. If a matching employee is found, the program should print out the employee's age, salary, and department. If no matching employee is found, the program should print an error message. The program should use a linear search algorithm to find a matching employee in the array. If the employee's age is greater than 50, their salary should be multiplied by 1.1. If the employee's age is less than or equal to 50, their salary should be divided by 1.2. 2) Write a C program that defines a function called 'multiply_by_two' that takes an integer as an argument and returns the result of multiplying it by 2. The main function of the program should prompt the user to enter integer, call the 'multiply_by_two' function with the user-entered integer as an argument, and then print out the result returned by the function. In addition to the basic functionality described above, the program should also have the following features:The program should continue to prompt the user for integers and perform the multiplication until the user enters a negative number. 3) The program should keep track of the total number of multiplications performed and the total sum of all the results, and should print out these values after the user has entered a negative number. The program should define a second function called 'is_even' that takes an integer as an argument and returns 1 if the number is even, and 0 if the number is odd. The 'multiply_by_two' function should use the 'is_even' function to determine whether the input number is even or odd, and should only perform the multiplication if the input number is even. If the input number is odd, the 'multiply_by_two' function should return 0 without performing the multiplication. For example, if the user enters the following integers: 5, 4, -3, 6, the program should output: Number of multiplications: 2 Total sum of results: 32 4) Write a C program that reads in a string from the user, removes all vowels from the string, and then prints the modified string. The program should be case-insensitive, so it should remove both uppercase and lowercase vowels. For example, if the user enters the string 'Hello World!', the program should print out 'HII Wrd!'. If the user enters the string 'This is a test', the program should print out 'Ths s tst'." 5) Write a C program that reads in a string from the user and determines whether the string is a palindrome (i.e., a word that is spelled the same forwards and backwards). The program should ignore spaces and punctuation, and should be case-insensitive. For example, the strings 'racecar', 'A man a plan a canal Panama', and 'radar' should all be considered palindromes by the program. The strings 'hello', 'world', and 'This is not a palindrome' should not be considered palindromes
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Reference Types in Function
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education