adspace
how to write a program to accept names and marks of 10
students from the user and display the names and markes of
only the passed students. Marks greater than or equal to
35 is considered as pass.
Answer Posted / rakesh ramesh
'Code using dictionary object, Inputs are not restricted to
proper values
Function marks()
Dim dict , passed, name, studMark
Set dict = CreateObject("Scripting.Dictionary")
Set passed = createObject("Scripting.Dictionary")
for i=0 to 10
name = InputBox("Stud name :")
studmark= InputBox("enter mark :")
dict.Add name, mark
if studMark>34 then
passed.Add name, studmark
end if
Next
For each i in passed
msgbox i & " : " & passed(i) & " - is passed"
Next
End Function
Call marks()
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category