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

Question DetailsNormal
$ 22.00

CMIS 102 Hands-On Lab Week 3 COMPLETE SOLUTION

Question posted by
Online Tutor Profile
request

1 CMIS 102 Hands-On Lab Week 3 Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, design, pseudocode visualization, and implementation with C code. The example provided uses mathematical operators and variable types. Program Description This program will calculate the area of a right triangle. The program will ask the user to enter the base and height and then use these values to calculate and then print the area of the triangle. The design step will include pseudocode. Analysis I 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 are possible and not just whole numbers. Float number will store the area: area The 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.13 Test Plan To verify this program is working properly the following base and height values could be used for testing: Test Case Input Expected Output 1 Base=10.1 Height = 12.2 Area = 61.61 2 Base=2.67 Height = 3.23 Area = 4.31 3 Base=100.0 Height = 400.0 Area =20000.0 2 Pseudocode // This program will calculate the area of a right triangle. // Declare variables Declare base, height, area as Float // Ask User for Inputs Write “Enter triangle base:” Input base Write “Enter triangle height:” Input height // Set value of area Set area=1/2*(base * height) // Print area Print “Area of triangle is “ + area C Code The following is the C Code that will compile in execute in the online compilers. // C code // This program will calculate the area of a right triangle. // Developer: Faculty CMIS102 // Date: Jan 31, XXXX #include int main () { /* variable definition: */ float base, height, area; /* Prompt user for base */ printf("Enter the base of the triangle: \n"); // Input the base scanf("%f", &base); /* Prompt user for height */ printf("Enter the height of the triangle: \n"); // Input the base scanf("%f", &height); // Calculate the Area area= 0.5 * (base * height); // Print the result printf("Area is : %f\n", area); return 0; } 3 Setting up the code and the input parameters in ideone.com: Note the base and height (10.1 and 12.2) are entered in the enter input (stdin) field. You can change these values to any valid float values to match your test cases. 4 Learning Exercises for you to complete 1. Change the C code to calculate the perimeter of a triangle. Support your experimentation with a screen capture of executing the new code 2. Prepare a new test table with at least 3 distinct test cases listing input and expected output for the 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,%f\n", 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. Submission Submit a neatly organized word (or PDF) document that demonstrates you successfully executed this lab on your machine using an online compiler. You should provide a screen capture of the resulting output. Also, provide the answers, associated screen captures, C Code and descriptions of your successful completion of learning exercises 1, 2, 3 and 4. The answers to the learning exercises, screen captures, C code and descriptions can be included in the same neatly organized document you prepared as you ran this lab. Note the code can be embedded in the word document. However; be sure all code compiles and runs perfectly before submitting the document. Submit your document no later than the due date listed in the syllabus or calendar. 5 Grading guidelines Submission Points Successfully demonstrates execution of this lab with online compiler. Includes a screen capture. 3 Provides a new test table with at least 3 distinct test cases listing input and expected output for the perimeter of a triangle. 2 Accurately describes the purpose of the scanf code. Accurately describes how to modify the code to input an integer as opposed to a float 2 Accurately describe why are the values of f and g different for the provided code? Supports your experimentation with screen captures of executing the code 2 Document is well-organized, and contains minimal spelling and grammatical errors. 1 Total 10

Available Answer
$ 22.00

[Solved] CMIS 102 Hands-On Lab Week 3 COMPLETE SOLUTION

  • This solution is not purchased yet.
  • Submitted On 26 May, 2016 10:39:29
Answer posted by
Online Tutor Profile
solution
1 CMIS 102 Hands-On Lab Week 3 Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, design, pseudocode visualization, and implementation with C code. The example provided uses mathematical operators and variable types. Program Description This program will calculate the area of a right triangle. The program will ask the user to enter the base and height and then use these values to calculate and then print the area of the triangle. The design step will include pseudocode. Analysis I 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 are possible and not just whole numbers. Float number will store the area: area The 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.13 Test Plan To verify this program is working properly the following base and height values could be used for testing: Tes...
Buy now to view the complete solution
Other Similar Questions
User Profile
Tutor...

University of Maryland CMIS 102 Hands-On Lab Week 8 Lab

CMIS 102 Week 8 Hands-On Lab 1. To successfully carry out this code I assigned the sum of rainfall to a variable called totalRain. This variable is defined as the rainfall of each month of the year in the array. I also decla...
User Profile
vpqnr...

CMIS 102 Hands-On Lab Week 5 complete solutions correct answers key

CMIS 102 Hands-On Lab Week 5 complete solutions correct answers key CMIS 102 Hands-On Lab Week 5 Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the ...
User Profile
vpqnr...

CMIS 102 Hands-On Lab Week 8 complete solutions correct answers key

CMIS 102 Hands-On Lab Week 8 complete solutions correct answers key CMIS 102 Hands-On Lab Week 8 Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the pr...
User Profile
vpqnr...

CMIS 102 Hands-On Lab Week 7 complete solutions correct answers key

CMIS 102 Hands-On Lab Week 7 complete solutions correct answers key CMIS 102 Hands-On Lab Week 7 Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the ...
User Profile
vpqnr...

CMIS 102 Hands-On Lab Week 6 complete solutions correct answers key

CMIS 102 Hands-On Lab Week 6 complete solutions correct answers key CMIS 102 Hands-On Lab Week 6 Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the ...

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