Cash-back offer from May 2nd to 7th, 2024: Get a flat 10% cash-back credited to your account for a minimum transaction of $50.Post Your Questions Today!

Question DetailsNormal
$ 28.00

ECE 175: Computer Programming for Engineering Applications

Question posted by
Online Tutor Profile
request

ECE 175: Computer Programming for Engineering Applications

Spring 2016

Lab Assignment #6 (Thursday session)

complete solutions correct answers key 

 

 

Problem 1 (15 points): Develop a C program to find a lower triangular matrix of a given matrix A and a product of all diagonal elements of A. 

Lower triangular matrix is a 2D array such that every elements above the main diagonal = 0.

Your program must be written using loops such that it works with any given SIZE of a matrix and should use the following prototypes:

#define SIZE 3          //Change this to match the size of matrix used in main()

 

//this function is to create lower triangular matrix of A (create A_lower)

void findLower(double A[][SIZE], double A_lower[][SIZE]);

 

//this function is to find product of all diagonal elements

void ProductDiagonal(double x[][SIZE], double *product);

 

//this function is to print 2D array x in a matrix format

void PrintMatrix(double x[][SIZE]);

 

 

Sample code execution 2:

M =

  9.10   13.40    5.20    2.70

  1.80   11.00    7.50    6.90

  3.50    7.30    4.60    1.25

  6.50    0.00    7.80   10.00

 

lower(M) =

  9.10    0.00    0.00    0.00

  1.80   11.00    0.00   0.00

  3.50    7.30    4.60    0.00

  6.50    0.00    7.80   10.00

 

Product of all diagonal elements = 4604.600

Press any key to continue . . .

You will initialize the 2D array (matrix) directly in your (main) code for given matrices (2D arrays) shown in sample code executions. 

 

 

Sample code execution 1:

M =

  0.71   -0.71    0.85

  0.61    0.61   -0.50

  0.35    0.35    0.87

 

lower(M) =

  0.71    0.00    0.00

  0.61    0.61    0.00

  0.35    0.35    0.87

 

Product of all diagonal elements = 0.377

Press any key to continue . . .

Sample code execution 3:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Problem 2 (15 points):

A palindrome is a word that reads the same forward as it does backward.

-          An example of a valid palindrome is the word "racecar".

-          An example of a word that is not a palindrome is "trust" (it reads backwards as "tsurt").

 

Develop a C program that

-          Ask a user to enter one word

-          Decide whether the entered word is a palindrome

-          Be interactive (q to quit, others to continue)

 

Note: assume that a maximum number of characters for one word is 50

See sample code execution below:

red – entered by a user

 

Enter a word: racecar

racecar is a palindrome

Press q/Q to quit, others to continue: y

 

Enter a word: trust

trust is NOT a palindrome

Press q/Q to quit, others to continue: t

 

Enter a word: detartrated

detartrated is a palindrome

Press q/Q to quit, others to continue: s

 

Enter a word: minimum

minimum is NOT a palindrome

Press q/Q to quit, others to continue: r

 

Enter a word: rotator

rotator is a palindrome

Press q/Q to quit, others to continue: a

 

Enter a word: 175ece571

175ece571 is a palindrome

Press q/Q to quit, others to continue: c

 

Enter a word: testset

testset is a palindrome

Press q/Q to quit, others to continue: q

 

 

 

 

 

 

Available Answer
$ 28.00

[Solved] ECE 175: Computer Programming for Engineering Applications

  • This solution is not purchased yet.
  • Submitted On 18 Mar, 2016 01:26:46
Answer posted by
Online Tutor Profile
solution
ECE 175: Computer Programming for Engineering Applications Spring 2016 Lab Assignment #6 (Thursday session) complete solutions correct answers key Problem 1 (15 points): Develop a C program to find a lower triangular matrix of a given matrix A and a product of all diagonal elements of A. Lower triangular matrix is a 2D array such that every elements above the main diagonal = 0. Your program must be written using loops such that it works with any given SIZE of a matrix and should use the following prototypes: #define SIZE 3 //Change this to match the size o...
Buy now to view the complete solution
Other Similar Questions
User Profile
kmgina

ECE 175: Computer Programming for Engineering Applications

ECE 175: Computer Programming for Engineering Applications Spring 2016 Lab Assignment #6 (Thursday session) complete solutions correct answers key Problem 1 (15 points): Develop a C program to find a lower triangular matri...

The benefits of buying study notes from CourseMerits

homeworkhelptime
Assurance Of Timely Delivery
We value your patience, and to ensure you always receive your homework help within the promised time, our dedicated team of tutors begins their work as soon as the request arrives.
tutoring
Best Price In The Market
All the services that are available on our page cost only a nominal amount of money. In fact, the prices are lower than the industry standards. You can always expect value for money from us.
tutorsupport
Uninterrupted 24/7 Support
Our customer support wing remains online 24x7 to provide you seamless assistance. Also, when you post a query or a request here, you can expect an immediate response from our side.
closebutton

$ 629.35