You are on page 1of 8

END

shsr,ndcs,lc,pc,hsr,csr,fsr, smsr,ndvs,msr,vsr,type, next=y

READ INPUT TYPE

INPUT TYPE

Y
INPUT shsr,ndcs,hsr

If Type = m?

N
INPUT smsr,ndvs,

lc=shsr/ndcs

lc=smsr/ndvs

PRINT lc

PRINT lc

INPUT pc,hsr

INPUT pc,msr

csr = lc*pc fsr = hsr+ csr

vsr = lc*pc fsr = msr + vsr

Print csr and fsr

Print csr and fsr

READ NEXT

INPUT NEXT

IfNEXT = Y?

Y
END

INTRODUCTION:
We created a program that gives the Full Scale Reading of the Vernier Caliper and Micrometer Screw Gau ge. By asking for the value of Smallest Main Scale/Horizontal Reading (SMSR/SMHR), Number of the Division in Vernier/Circular Scale (NDVS/NDCS), Point of Coincidence (PC), and Main/Horizontal Scale Reading (MSR/HSR). To compute for the Least Count (LC), Vernier/Circular Scale Reading (VSR/CSR) in order to get the Full Scale Reading (FSR). The Vernier Caliper was inveted by the French scientist Pierre Vernier(1580-1637), it is a wellknown tool for high-resolution length meaurements. The Caliper consists of two graduated scales, a main scale like a ruler and a second scale, the vernier, which slides parallel to the main scale. The two scales have a small relative pitch difference. Taking Measurement in the Vernier Caliper 1. Least Count is the ratio between the Smallest Main Scale Reading with the Number of Division of Vernier Scale. 2. Point of Coincidence it is the point where the two scale meet in the vernier caliper. 3. Main Scale Reading is known as Initial Reading. It is the number of divisions passed by the zero0 mark of the Vernier scale. 4. Vernier Scale Reading is the product of Least Count and Point of Coincidence. 5. Full Scale reading is the sum of Main Scale Reading and Vernier Scale Reading.

The Micrometer is a device incorporating a calibrated screw used widely for precise measurements of small distances in mechanical engineering and machining as well as most mechanical trades, along with other metrological instruments. Micrometers are often, but always, in the form of calipers. Taking Measurement in the Vernier Caliper 1. Least Count is the ratio between the Smallest Horizontal Scale Reading with the Number of Division of Circular Scale. 2. Point of Coincidence it is the point where the two scale meet in the vernier caliper. 3. Horizontal Scale Reading is known as Initial Reading. It is the number of divisions passed by the zero0 mark of the Circular Scale. 4. Circular Scale Reading is the product of Least Count and Point of Coincidence. 5. Full Scale reading is the sum of Horizontal Scale Reading and Circular Scale Reading.

Problem
Create a program that computes for the Full Scale Reading of an object measured by the two High Precision Instrument.

Algorithm
1. Start 2. Declare variables: Type for the type of measuring instrument, next for the next action (whether to repeat the transaction or exit the program), smsr for Smallest Main Scale Reading, ndvs for number of Division of Vernier Scale, vsr for Vernier Scale Reading, msr for Main Scale Reading, shsr for Smallest Horizontal Scale Reading, hsr for Horizontal Scale Reading, csr for Circular Scale Reading, ndcs for Number of Division of Circular Scale, lc for Lease Count, pc for Point of Coincidence, and fsr for Final Scale Reading. 3. Ask the user what measuring instrument (whether [v] for the vernier calliper or [m] for the micrometer. 4. If the type is [v], the user will be asked to enter the smsr and ndvs, the program will compute and display for lc, enter the value for pc , and it will compute for the value of vsr, enter the value for msr, to compute and display for the fsr, else if the type is [m],the user will be asked to enter the shsr and ndcs, the program will compute and display for the lc , enter the value for pc, and it will compute and display for the value of csr, enter the value for the hsr, to compute and display for the fsr, else the program will display ``INVALID INPUT``. 5. The user will be asked if he wants another transaction. If the user entered ``y`` or ``Y``, the program will repeat from [3] else the program will terminate. 6. End

PROGRAM PLAN
Required Output:
Full Scale Reading of Instruments Please choose from the following measuring instruments: [v] Vernier Caliper [m] Micrometer Enter SMSR: 9999. 99 Enter NDVS: 9999. 99 LC = 9999. 99 Enter PC: 9999. 99 Enter MSR: 9999. 99 VSR = 9999. 99 FSR = 9999. 99

Available Input:
Smallest Main Scale Reading [SMSR] Smallest Horizontal Scale Reading [SHSR] Number of Divisions of Vernier Scale [NDVS] Number of Divisions of Circular Scale [NDCS] Point of Coincidence [PC] Main Scale Reading [MSR] Horizontal Scale Reading [HSR]

Processing Requirement:
LC = SMSR/NDVS VSR = (LC) (PC) FSR= MSR + VSR CSR = (LC) (PC) FSR= HSR + CSR

PSEUDOCODE
REPEAT INPUT TYPE IF TYPE = V INPUT SMSR, NDVS LC = SMSR/NDVS PRINT LC INPUT PC, MSR VSR = (LC) (PC) FSR= MSR + VSR PRINT VSR, FSR IF TYPE = M INPUT SHSR, NDCS LC = SHSR/NDCS PRINT LC INPUT PC, HSR CSR = (LC) (PC) FSR= HSR + CSR INPUT NEXT IF NEXT = y REPEAT IF NEXT = n STOP END

Program Code:
#include<iostream.h> #include<stdlib.h> int main() { int type; char next = 'y'; float shsr, lc, hsr, csr, fsr, ndcs, pc, smsr, ndvs, vsr, msr; do { cout<<"=======================================================\n"; cout<<" Full Scale Reading of Intruments\n=======================================================\n"; cout<<"Please choose from the following measuring instruments: \n"; cout<<" cout<<" cin>>type; cout<<"=======================================================\n"; if (type==1) { cout<<" cin>>smsr; cout<<" cin>>ndvs; lc=smsr/ndvs; cout<<" cout<<" cin>>pc; cout<<" cin>>msr; vsr=lc*pc; fsr=msr+vsr; cout<<" cout<<" } else if (type==2) { VSR = "<<vsr<<"\n"; FSR = "<<fsr<<"\n"; Enter MSR: "; LC = "<<lc<<"\n"; Enter PC: "; Enter NDVS: "; Enter SMSR: "; [1] Vernier Caliper \n"; [2] Micrometer \n ";

cout<<" cin>>shsr; cout<<" cin>>ndcs;

Enter SHSR: "; Enter NDCS: ";

lc=shsr/ndcs; cout<<" cout<<" cin>>pc; cout<<" cin>>hsr; lc=shsr/ndcs; csr=lc*pc; fsr=hsr+csr; cout<<" cout<<" } else { cout<<" } cout<<"=======================================================\n"; cout<<"Do you want to do another measurement?\n"; cout<<" Press 'y' to continue or any key to exit\n "; cin>>next; } while ((next=='y')||(next=='Y')); system("PAUSE"); return 0; } Invalid Input!"; CSR = "<<csr<<"\n"; FSR = "<<fsr<<"\n"; Enter HSR: "; LC = "<<lc<<"\n"; Enter PC: ";

You might also like