Question: Q 1, 3 Section Objectives: After completing this lab, you will be able to: .Analyze and sketch an algorithm to solve a problem. .Edit, compile,

Q 1, 3
Section Objectives: After completing this lab, you will be able to: .Analyze and sketch an algorithm to solve a problem. .Edit, compile, build, and test C++ programs Lab Exc. Mark Score Exercise #1: Thousands, Hundreds, Tens, and Units Write a program that prompts for a positive integer. The program prints how many thousands, hundreds, tens, and Sample input/output: units in the given integer Enter a number: 32588 2588 has 32 thousands, 5 hundreds, e tens , and 8 units Exercise #2: Numbers Swapping: Write a program to swap the values of two variables. Sample input/output: nter the value of x: 9 nter the value of y: 7 he swapping Results will be as follows: Exercise #3: Distance between 2 points: Write a program in C++ to compute the distance between two points on the plan. The Euclidean distance between points P(xi,y1) and Q(x2,y2) is given by the following formula: d v(x1-x2) (y1 - y2)2 ample input/output: E Select CAUsers 10918Desktopiq2.exe Enter the first point P(xi,y1): 2.5 5.8 Enter the second point Q(x2,y2): 3.5 8.5 The distance between the two points P and Q is2.87924 rocess returned e (exe) execution time19.312 s
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
