[Solved] SOLVED: Assignment #8

$25

File Name: SOLVED:_Assignment_#8.zip
File Size: 197.82 KB

SKU: [Solved] SOLVED: Assignment #8 Category: Tag:
5/5 - (1 vote)

Program A: Greeting (greeting.c):Your friend is writing a program that will be used by many different types of people. Hes so busy focusing on making it perfect for everyone that he has decided to recruit some friends to help him complete some of the smaller, but certainly still important, parts. Hes asked you to write the greeting interface.Given the users name and their name prefix, output a welcome message to them. A name will always be a string that is less than 100 characters in length and does not contain spaces.A prefix will be input as an integer to select from a list. See the sample input for the list that should be used. If an option is input that is not on the list, just leave off the prefix.You may write any functions you find useful in this program, but you are not required to have any for this program.Sample Run (user input in bold and italics):What is the users name?BoswellWhat is the users name prefix?(1) Mr.(2) Ms.(3) Mrs.(4) Dr.1Hello Mr. Boswell, welcome to the program!Sample Run (user input in bold and italics):What is the users name?JohnWhat is the users name prefix?(1) Mr.(2) Ms.(3) Mrs.(4) Dr.0Hello John, welcome to the program!

Program B: Matrix Multiply (matrixmultiply.c): In mathematics, especially in the context of programming, it is quite common to work with matrices. A matrix (plural matrices) is a 2D grid of numbers used to represent data in various ways. There are many different interesting ways to solve all kinds of challenging problemsusing matrices. But lets just stick to something basic for now. Often is is useful to multiply two matrices together, resulting in a single result matrix. Given two matrices, multiply them and output this result.Normally matrices have varying height and width, and there are specific restrictions on what each of these can be for each matrix in order to multiply them together. For simplicity, though, well just say both of the matrices are NxN in size, which results in a result of size NxN.In order to compute a cell (row, column) of a result matrix, R, of the multiplication of A and B,you can use the following formula (where each matrix is NxN):[r][c] [r][i] [i][c] R = Ni=0A * BIn other words, each cell of the result matrix is the (dot) product using respective pairs of the corresponding cells in the row of A and column of B. If you still find this unclear, you may choose to consult the many Google results you will get for matrix multiplication (of two matrices), since as stated, this is a very common procedure in mathematics and as such there are many different ways to explain it.The first line of input will be a positive integer N. The following lines will be the NxN numbers in A, followed by then NxN numbers in B. You should then output the product A*B, as a grid(matrix).You may write any functions you find useful in this program, but you are not required to have any for this program.Sample Run (User input in bold and italics):31 2 34 5 67 8 910 11 1213 14 1516 17 1884 90 96201 216 231318 342 366(Note: spacing in the above sample was modified for clarity. If you want to do this, you can use %3d instead of %d to output your numbers. But this is not required.)Sample Run (User input in bold and italics):35 3 21 5 26 3 62 5 81 3 25 2 123 38 4817 24 2045 51 60Sample Run (User input in bold and italics):21 11 01 11 02 11 1Program C: Birthday Lookup (birthdays.c):Recently, youve found yourself having difficulty remembering all of your many friends birthdays. So youve decided to write a program to help you (because really, who would want to rely on silly social networking sites reminders when you can write your own program to doit?). Write a program that will read a list of names and birthdays from the file birthdays.txt into your program. The format of this file will first be an integer, N ( ), followed 1 N 50 by N lines that contain the first name, last name, and birthday of a person, separated by a spaces. The program should then read a series of birthday queries from standard input. A birthday query should always consist of exactly 5 characters of the form MM/DD, where MM is the two digitmonth and DD is the two digit day. Birthdays in the file will correspond to this format as well.Names will each consist of a first and last name, separated by a space. First and last names will not contain any spaces and will each be at most 50 characters. For each query, in order, output the names of everyone who has a birthday on that day. The queries will end with the word DONE.Hint: because the date format is the same in the file and the queries, your program doesntneed to understand the format, it should just look for an exact string match.Sample Run (User input in bold and italics):Enter a date (MM/DD) or DONE:03/29The following people have birthdays on 03/29:John TylerEnter a date (MM/DD) or DONE:08/04The following people have birthdays on 08/04:Barack ObamaEnter a date (MM/DD) or DONE:11/02The following people have birthdays on 11/02:James PolkWarren HardingEnter a date (MM/DD) or DONE:01/01The following people have birthdays on 01/01:(None)Enter a date (MM/DD) or DONE:DONEThe input for the above sample was using a file containing the birthdays of all US presidents.See the assignments section under Files on webcourses for this sample file (birthdays.txt).Deliverables:Please submit three separate .c files for your solutions to these problems via WebCourses bythe designated due date:Program A: greeting.cProgram B: matrixmultiply.cProgram C: birthdays.c

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED: Assignment #8
$25