ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 25 May 2017 My Price 8.00

1CMIS 102 Hands-On LabWeek 3

Learning Exercises for you to complete

1. Change the C code to calculate the perimeter of a triangle. Support your experimentation with ascreen capture of executing the new code

2. Prepare a new test table with at least 3 distinct test cases listing input and expected output  perimeter of a triangle.

3. What is this line of code doing? scanf("%f", &height);How would you change this line if you wanted to input an Integer as opposed to a float?

4. What are the values of f and g after executing the following C?

#include < 

int main(void) { int i,j;

float f,g; i = 5;

j = 2; f = 3.0;

f = f + j / i;

g = (f + j )/i;

printf("value of f,g is %f,%fn", f,g);

return 0;}

Describe specifically, and in your own words, why are the values of f and g different?

Support your experimentation with a screen capture of executing the code.

 

1CMIS 102 Hands-On LabWeek 3OverviewThis hands-on lab allows you to follow and experiment with the critical steps of developing a programincluding the program description, analysis, test plan, design, pseudocode visualization, andimplementation with C code.The example provided uses mathematical operators and variable types.Program DescriptionThis program will calculate the area of a right triangle. The program will ask the user to enter the baseand height and then use these values to calculate and then print the area of the triangle. The design stepwill include pseudocode.AnalysisI will use sequential programming statements.I will define two float numbers for the base and height: base, height.Float numbers were selected as opposed to integers to make sure triangles of all dimensions arepossible and not just whole numbers.Float number will store the area: areaThe area will be calculated by this formula:Area = ½ * (base * height)For example if the base was 4.2 and the height was 5.3 the area would be calculated as:Area = ½ * (4.2 * 5.3) = ½ * (22.26) = 11.13Test PlanTo verify this program is working properly the following base and height values could be used fortesting:Test CaseInputExpected Output1Base=10.1 Height = 12.2Area = 61.612Base=2.67 Height = 3.23Area = 4.313Base=100.0 Height = 400.0Area =20000.0

Answers

(11)
Status NEW Posted 25 May 2017 01:05 AM My Price 8.00

-----------

Attachments

file 1495674964-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)