Question: C++ Programming, output must follow the sample output given. Thanks! Fig. 1 shows a Wheatstone Bridge circuit. The Wheatstone Bridge circuit is considered to be


Fig. 1 shows a Wheatstone Bridge circuit. The Wheatstone Bridge circuit is considered to be balanced if the potential difference between B&D (Vao) is equal to zero. When the circuit is balanced, the ratio of Rg/R = R./R.. A resistance of unknown value R can be determined by replacing R, and R, with known resistance values and adjusting the variable resistance R, to achieve a balance condition (Vuo=0). E D Fig 1: Wheatstone Bridge circuit. General Requirements: Write a Ch+ program that can perform 3 different tasks. The program should begin by showing the available options and prompt the user to select an option to proceed. After completing the selected task, the program will show the options list again. The program will repeat indefinitely unless the user chooses Option 4 to exit the program. Option 1: Find the value of unknown resistance R. (30 marks) The program will prompt the user to input 2 resistance values R. & Rain Ohms. The values of R. & R: must be between 100 and 100,000 Ohms. The program will then simulate the process of adjusting R, to achieve a balanced condition by generating a random value between 100 and 100,000 Ohms. Next, the program informs the user of the value R2 that will cause the circuit to be balanced. Finally, the program calculates the value of the unknown resistor R.. Option 2: Check whether the Wheatstone Bridge is balanced. (20 marks) The program will prompt the user to enter the values of all resistors (100-100,000 Ohms) and inform the user the circuit is balanced or not. Option 3: Calculate the circuit's total resistance and current (20 marks) The program will prompt the user to enter the values of all resistors (100-100,000 Ohms) and the supply voltage level (1 to 240 V). The program calculates and informs the user of the total resistance and current of the circuit (R+R) (Rz + Rx) (R+ Ry) + (R3 + Rx) RE V=IR Option 4: Exit program (5 marks) Stops the program Specific Requirements: Tasks in Option 1, 2 & 3 must be performed in separate functions, Opt10), Opt20) and Opt3(). (5 marks) Reduce the duplication of codes in your program as much as possible. You may introduce new functions to avoid code duplication. (20 marks) A sample output of the program is shown in Fig 2. 3D WD1004 Program Deneme welcome to the heatstone Bridge program, here are the waite options 31 Find the value of unknown resistance 2: Check whether the Wheatstone Bridge is balanced 5: Calculate the circuit's total resistance and current Exit program please input your selection (1-4): S Errort Re-enter valve (1-4) 1 Executing option ! Enter the value of in Ohns (0-10000) Errort Re-enter value (100-300000): se Enter the value of Rin Ches (300-300000): 100 djusting 12 to balance the wheatstone trider circuit, please wait... Done, balance is achieved when R2 is he The value of Br is 1500. Chris el.come to the wheatstone Bridge program, here are the wailable options: 1: Find the value of unknown resistance to 2: Check whether the wheatstone Bridge is balanced 31 Calculate the circuit's total resistance and current Exit program Please Input your selection: (1-4): 2 Executing Option 2 Enter the value of Rs in Ches (100-300000): Error! Ne-enter value (100-300000): 300 Enter the value of R2 in Chas (100-300000): 20 Enter the value of 3 in Ohrs (200-300000): se Enter the value of Rx in Ohns (300-300000): 400 The wheatstone Bridge circuit is NOT balanced Welcome to the heatstone Bridge progres, here are the wailable options: 1: Find the value of unknown resistance b. Check whether the Wheatstone Bridge is balanced 5: Calculate the circuit's total resistance and current 4: Exit program Please input your selection (3-4): 2 Executing Option 2 Enter the value of Rin Ohes (100-200000): 100 Enter the value of R2 in Chns (200-300000): 200 Enter the value of 3 inches (300-20000) 100 Enter the value of xinhas (100-300000): 600 The Wheatstone Bridge circuit is balanced welcome to the heatstone Bridge program, here are the wailable options 1. Find the value of unknown resistance Box 2: Check whether the Wheatstone Bridge is balanced 2: Calculate the circuit's total resistance and current W: Exit program please Input your selection (1-4): Executing Option Enter the value of R1 in Ches (100-300000): 100 Enter the value of R2 in Ohes (50-100000) 100 Enter the value of Rin Ohes (300-300000): Error Re-enter value (100-100000) 100 Enter the value of Rx in Chas (100-300000): 200 Enter the value of Vin Volts (1-248) Error: Re-enter value (1-240): 50 The total resistance is 300 Ches, while the total current is ons Welcome to the weatstone Bridge program, here are the wailable options: 1: Find the value of unknown resistance Rx 2: Check whether the Wheatstone Bridge is balanced Calculate the circuit's total resistance and current txit program please input your selection (1-4)14 Thank you for using the wheatstone Bride programeve a nice day process returned (o) section time 115.398 Press any key to continue Fig. 2: Sample output of the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
