Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An intro C++ class so no advanced code please. Either c is ok, also need matlab for question specified 1. Include comments in your code

image text in transcribedAn intro C++ class so no advanced code please. Either c is ok, also need matlab for question specified

1. Include comments in your code giving your name, the date, and a code description. 2. Also include comments in your Output.doc/x that give the corresponding problem number 3. Whenever printing a value to the screen, also print a statement defining the value and any units. Example: Do "the distance x is 23 meters"; Don't "23". Problem 1 40 The natural logarithm can be reliably approximated across the range [0.01,2] by the sum- mation i=1 Write both C and Matlab scripts that accept inputs for the value of r and the number of summation terms and then prints the value of In(x) First solve this problem using a for loop. Then solve it using a while loop. These methods may be included in a single script. Print both outputs Problem 2 40 Write both C and Matlab scripts that allow a user to navigate through the departments at a company. The script should request a "department code" as an input. Print a statement to the screen directing the user to the department corresponding to their input. An example output message could say "You selected: 3. You are now being redirected to the Accounting department". Assume 5 or 6 departments. Account for what happens when a user inputs an invalid department code First solve this problem using only if/else if conditional statements. Then solve it using a case/switch syntax. These methods may be included in a single script. Print both outputs Problem 3 [30 Using whatever method you like in whichever language you like (C or Matlab), write a script that includes a function (not main) which solves for the roots of the quadratic equation where a, b, and c are accepted as inputs. The roots should be presented in complex form

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

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions