Friday, August 03, 2012

pseudocode for problems

Write down all the Pseudocode for the previous problem which we have discussed in the class? 

15 comments:

shivam agggarwal said...

Accept five numbers and the average of those five numbers :-
Begin
Numeric nNum1, nNum2, nNum3, nNum4, nNum5, nSum, NAvg
Display “Enter number”
Accept nNum1
Display “Enter number”
Accept nNum2
Display “Enter number”
Accept nNum3
Display “Enter number”
Accept nNum4
Display “Enter number”
Accept nNum5
nSum= nNum1+nNum2+nNum3+nNum4+nNum5
Display “total is”
Display nSum
nAvg= nSum/5
Display “equal to”
Display nAvg
End






Accept the quantity and price per unit and display the total amount:-
Begin
Numeric nQuantity, nPrice_(per unit), nAmount
Display “nQuantity”
Accept nQuantity
Display “nprice_(per unit)”
Accept nprice_(per unit)
nAmount = nQuantity*nPrice_(per unit)
Display “equal to”
Display nAmount
end

Jatinder S Randhawa said...

Good Work
Please Write Enter Number1 Enter Number2 and so on and donot use () brackets in variable names

Unknown said...

Accept five numbers and the average of those five numbers :-
Begin
Numeric nNum1, nNum2, nNum3, nNum4, nNum5, nSum, NAvg
Display “Enter number1”
Accept nNum1
Display “Enter number2”
Accept nNum2
Display “Enter number3”
Accept nNum3
Display “Enter number4”
Accept nNum4
Display “Enter number5”
Accept nNum5
nSum= nNum1+nNum2+nNum3+nNum4+nNum5
Display “total is”
Display nSum
nAvg= nSum/5
Display “equal to”
Display nAvg
End






Accept the quantity and price per unit and display the total amount:-
Begin
Numeric nQuantity, nPrice_per unit, nAmount
Display “nQuantity”
Accept nQuantity
Display “nprice_per unit”
Accept nprice_per unit
nAmount = nQuantity*nPrice_per unit
Display “equal to”
Display nAmount
end

Unknown said...

karneet kaur....
Pseudocode to accept distance in kilometers convert it into meter & display result???
sol-: Begin
numeric ndis, nresult
display'enter distance'
accept ndistnce
nresult=ndistance*1000
display'distance in meters:'+nresult
end

Unknown said...

Accept five numbers and the average of those five numbers :-
Begin
Numeric nNum1, nNum2, nNum3, nNum4, nNum5, nSum, NAvg
Display “Enter number1”
Accept nNum1
Display “Enter number2”
Accept nNum2
Display “Enter number3”
Accept nNum3
Display “Enter number4”
Accept nNum4
Display “Enter number5”
Accept nNum5
nSum= nNum1+nNum2+nNum3+nNum4+nNum5
Display “total is”
Display nSum
nAvg= nSum/5
Display “equal to”
Display nAvg
End










Accept the quantity and price per unit and display the total amount:-
Begin
Numeric nQuantity, nPrice_per unit, nAmount
Display “nQuantity”
Accept nQuantity
Display “nprice_per unit”
Accept nprice_per unit
nAmount = nQuantity*nPrice_per unit
Display “equal to”
Display nAmount
end

shivam agggarwal said...

Accept five numbers and the average of those five numbers :-
Begin
Numeric nNum1, nNum2, nNum3, nNum4, nNum5, nSum, NAvg
Display “Enter number1”
Accept nNum1
Display “Enter number2”
Accept nNum2
Display “Enter number3”
Accept nNum3
Display “Enter number4”
Accept nNum4
Display “Enter number5”
Accept nNum5
nSum= nNum1+nNum2+nNum3+nNum4+nNum5
Display “total is”
Display nSum
nAvg= nSum/5
Display “equal to”
Display nAvg
End






Accept the quantity and price per unit and display the total amount:-
Begin
Numeric nQuantity, nPrice_per unit, nAmount
Display “nQuantity”
Accept nQuantity
Display “nprice_per unit”
Accept nprice_per unit
nAmount = nQuantity*nPrice_per unit
Display “equal to”
Display nAmount
end

Jatinder S Randhawa said...

Good Work Done by My Team

Unknown said...

Accept five numbers and the average of those five numbers :-
Begin
Numeric nNum1, nNum2, nNum3, nNum4, nNum5, nSum, NAvg
Display “Enter number1”
Accept nNum1
Display “Enter number2”
Accept nNum2
Display “Enter number3”
Accept nNum3
Display “Enter number4”
Accept nNum4
Display “Enter number5”
Accept nNum5
nSum= nNum1+nNum2+nNum3+nNum4+nNum5
Display “total is”
Display nSum
nAvg= nSum/5
Display “equal to”
Display nAvg
End




Accept the quantity and price per unit and display the total amount:-

Begin
Numeric nQuantity, nPrice_per unit, nAmount
Display “nQuantity”
Accept nQuantity
Display “nprice_per unit”
Accept nprice_per unit
nAmount = nQuantity*nPrice_per unit
Display “equal to”
Display nAmount
end

Unknown said...

Accept five numbers and the average of those five numbers :-
Begin
Numeric nNum1, nNum2, nNum3, nNum4, nNum5, nSum, NAvg
Display “Enter number1”
Accept nNum1
Display “Enter number2”
Accept nNum2
Display “Enter number3”
Accept nNum3
Display “Enter number4”
Accept nNum4
Display “Enter number5”
Accept nNum5
nSum= nNum1+nNum2+nNum3+nNum4+nNum5
Display “total is”
Display nSum
nAvg= nSum/5
Display “equal to”
Display nAvg
End






Accept the quantity and price per unit and display the total amount:-
Begin
Numeric nQuantity, nPrice_per unit, nAmount
Display “nQuantity”
Accept nQuantity
Display “nprice_per unit”
Accept nprice_per unit
nAmount = nQuantity*nPrice_per unit
Display “equal to”
Display nAmount
end

Unknown said...

Arshdeep Kaur
1.Pseudocode to accept two numbers, divide the first number with second number &
display its quotient.
Sol: begin
numeric NUM1,NUM2,ndiv
display'enter first number'
accept nNUM1
display 'enter second number'
accept nNUM2
ndiv=nNUM1/nNUM2
display ndiv
end
2.Pseudocode to accept item name, price, qty & display item name & total value. Total
value can be calculated as product of price & qty.
Sol: begin
numeric nprice, nqty, npro
character citemnane
display 'enter itemname'
accept citemname
display'enter price'
accept nprice
display'enter qty'
accept nqty
npro=nprice*nqty
display 'itemname'
display 'npro'
end
3.Pseudocode to accept 3 no's & display avg of those no's
Sol: begin
numeric nNUM1,nNUM2,nNUM3
display'enter nNUM1,nNUM2,nNUM3 '
accept nNUM1,nNUM2,nNUM3
avg=(nNUM1+nNUM2+nNUM3)/3
display avg
end
4.Pseudocode toaccept two no's & find greatest of two no's
Sol: begin
numeric nNUM1,nNUM2
display"enter the number1"
accept nNUM1
display"enter the number2"
accept nNUM2
if(nNUM1>nNUM2)
begin
display"largest no is"
display"nNUM1"
end
end
display"nNUM2"
end
end
5.Pseudocode to accept 2 no's & find largest of them
Sol: begin
numeric nNUM1,nNUM2,nNUM3
display "enter the number1"
accept nNUM1
display "enter the number2"
accept nNUM2
display "enter the number3"
accept nNUM3
if(nNUM1>nNUM2&&nNUM1>nNUM3)
begin
display'nNUM1'
end
elseb if (nNUM2>nNUM3)
begin
display 'nNUM2'
end
else
begin
display'nNUM3'
end
end
6.Pseudocode to evaluate a no. is even or not & display the no. is even in case of even
Sol: begin
numeric num1
display"enter number"
accept num1
if(num1%2==0)
begin
display"the no. is even"
end
else
begin
display"the no.is not even"
end
end

Gateway To Information Technology said...

Good Work done by all of you. Keep it Up

Gateway To Information Technology said...

Good Work done by all of You. Keep it Up

Unknown said...

2.Pseudocode to accept item name,price & quantity & display item name & total value
total value can be calculated as product of price & quantity.
Sol: begin
numeric nprice,nquantity,npro
character citemname
display'enter itemname'
accept citemname
display'enter price'
accept nprice
display'enter quantity'
accept nquantity
npro=nprice*nquantity
display'itemname'
display'npro'
end

Unknown said...

Q1 write the pseudo code to accept two no, divide the first no by second no and display their quotient?
Sol: begin
Numeric n num1, n num2, n quotient
Display “enter no for quotient “
Display “enter n num 1”
Accept “n num 1”
Display “enter n num 2”
Accept “n num 2”
N quotient =n num1/n num2
Display quotient
End

Q2: write the pseudo code that accept in kilometers, converts it into meters and display the result
Sol: begin
Numeric n kilometers, n meters
Display” enter n kilometer”
Accept n kilometer
N meter = n kilometer*1000
Display n meter
End

Q3: accept the marks of five subjects. Calculate the average. if the average > 85 print excellent . if the average is >65 and < 86 print good . If the average is >50 and<66 print fair. If the average is <50 print fail.
Begin
Numeric nnum1, nnum2, nnum3, nnum4, nnum5
Display “enter no for average”
Display “enter number 1”
Accept nnum1
Display “enter number2”
Accept nnum2
Display “enter number 3”
Accept n num3
Display” enters number4”
Accept nnum4
Display “enter number5”
Accept n num5
If (average >85)
Begin
Display excellent
End
Begin
Else If (average>65&average<86)
Display good
End
Begin
Else if (average>50&average<66)
Display fair
End
Begin
Else if (average<50)
Display fail
End
End




Unknown said...

Sol: begin
Numeric n num1, n num2, n quotient
Display “enter no for quotient “
Display “enter n num 1”
Accept “n num 1”
Display “enter n num 2”
Accept “n num 2”
N quotient =n num1/n num2
Display quotient
End

Q2: write the pseudo code that accept in kilometers, converts it into meters and display the result
Sol: begin
Numeric n kilometers, n meters
Display” enter n kilometer”
Accept n kilometer
N meter = n kilometer*1000
Display n meter
End

Q3: accept the marks of five subjects. Calculate the average. if the average > 85 print excellent . if the average is >65 and < 86 print good . If the average is >50 and<66 print fair. If the average is <50 print fail.
Begin
Numeric nnum1, nnum2, nnum3, nnum4, nnum5
Display “enter no for average”
Display “enter number 1”
Accept nnum1
Display “enter number2”
Accept nnum2
Display “enter number 3”
Accept n num3
Display” enters number4”
Accept nnum4
Display “enter number5”
Accept n num5
If (average >85)
Begin
Display excellent
End
Begin
Else If (average>65&average<86)
Display good
End
Begin
Else if (average>50&average<66)
Display fair
End
Begin
Else if (average<50)
Display fail
End
End