Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ENGR 1204 Programming Languages in Engineering Assignment 7 The first two problems are from S. Attaway, MATLAB-A Practical Introduction to Programming and Problem Solving (4th

image text in transcribed
ENGR 1204 Programming Languages in Engineering Assignment 7 The first two problems are from S. Attaway, MATLAB-A Practical Introduction to Programming and Problem Solving (4th Edition) For each problem, print out the script or function file if created and the relevant Command Window output 1. Chapter 7-Exercise 8 Test for three cases with different length strings. Use your own name and major in one of the tests. 2. Chapter 7-Exercise 26 Hint: Create a script which adds an index between -10 and 10 to the original character codes, and displays each new string (using disp will display them on separate lines). Write a script that will, in a loop, prompt the user for four course numbers. Each will bea string of length 5 of the form 'CS101'. These strings are to be stored in a character matrix. 3. Also provide an error message if a course number is not of length 5. The program should not store that number in the course matrix, but prompt the user for the next number. One approach is to use a while loop and check the length of the string entered A sample output is shown below: Enter 5 character course number : cs101 Enter 5 character course number : EE233 Enter 5 character course number : mel7 Not 5 characters - please re-enter number Enter 5 character course number: mel177 Not 5 characters -please re-enter number Enter 5 character course number: mel17 Enter 5 character course number: core106 Not 5 characters - please re-enter number Enter 5 character course number : coreA The 4 courses are: cs101 EE233 mel17 coreA Partner's name: Matt

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions