Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Homework # 4: CS 109 0 FALL. 2017/COMPUTER SCIENCE Alabama A&M University DUE DATE: Wednesday, 10/18/2017 Each stadent must submit this work by due date

image text in transcribed
Homework # 4: CS 109 0 FALL. 2017/COMPUTER SCIENCE Alabama A&M University DUE DATE: Wednesday, 10/18/2017 Each stadent must submit this work by due date SUBMIT ONLINE 2. Define a function Print that takes an integer N as imput, and prints (displays) a square of stars keeping N rows and N columns. ic. if N -3, the display should look like Answer cach question a) Suppose you have two fiunction definitions with the following fimction declarations: IrN - 4, then i should kook like double Scorefdouble time, double distance) int Score(double points) Which function definition would be used in the following function call and why it be the one used double x; ch>>x final score Scoretx) Now modify the function so that instead of printing a star, it should print an user specificd character chl. and send that variable as an input to the fanction Call this function from main properly, so that takes only one input N and displays the stars property b) What's wrong with the following function? vold Sqwarefint x) 3. In cold weather, meteorologists report an index called the windchill factor that takes into ntyx" return y account the wind speed and the temperature. The index provides a measure of the chilling effect of wind at a given air temperature. Windchill may be approximated by the formala: W 13.12 0.62151-11.37 VH+0.39651v Where c) In the following function title, which parameters are value parameters and which are reference v wind speed in m/s void ExamPrep(string&name, int age, float& salary, char level) both double variable and a character variable opType, and returns a double valuC a Boolean value TRUE or FALSE depending on if the number is even or odd. To test temperabure in degree Celsius t must be less than or equal to 10 to use this formala W windchill index (in degrces Celsms) d) Declare a fanction named MathOp that takes three imputs as parameters: a and b Wnite a fanction dhat takes v and t as inputs and retums the windchill index W. Your code should ensure that the restriction on the tenaperature is not violated c) Define function lsEven(number) which takes an integer number as input and tetras if the mumber is even, find out if the remainder is 0 when divided by 2

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

6. Vanguard

Answered: 1 week ago

Question

1. PricewaterhouseCoopers

Answered: 1 week ago