0 Replies - 1807 Views - Last Post: 26 October 2012 - 04:12 AM Rate Topic: -----

#1 alecia  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 26-October 12

Trouble with the designing a program using small basic

Posted 26 October 2012 - 04:12 AM

I am new at programming. have an assignment to calculate the GPA of a student by assigning a class, course names and output the information the program must also provide a summary report. I am only getting the user to enter course name, no other information is being output please assist me.
This is the first code I tried



For i = 1 To 10
Textwindow.Write("Course" + i + ", enter Course: ")
Course[i] = Textwindow.Read()
EndFor
Textwindow.WriteLine("______________________")
For i = 1 To 10
Textwindow.WriteLine(Course[i])
EndFor



then I tried this really long one :bigsmile:


Grade=0
Points1=0
points10=0
Textwindow.WriteLine ("Enter program:")
Program= Textwindow.Read()
Textwindow.WriteLine ("Enter Course:")
user["Course1"]= Textwindow.Read()
Textwindow.WriteLine ("Enter grade:")
user["Grade"]= Textwindow.Read()
Textwindow.WriteLine ("Enter credit points:")
user["points1"]= Textwindow.ReadNumber()

Textwindow.WriteLine ("Enter Course:")
user["Course2"]= Textwindow.Read()
Textwindow.WriteLine ("Enter grade:")
user["Grade"]= Textwindow.Read()
Textwindow.WriteLine ("Enter credit points:")
user["points2"]= Textwindow.ReadNumber()

Textwindow.WriteLine ("Enter Course:")
user["Course3"]= Textwindow.Read()
Textwindow.WriteLine (" Enter Grade:")
user["Grade"]= Textwindow.Read()
Textwindow.WriteLine ("Enter credit points:")
user["points3"]= Textwindow.ReadNumber()

Textwindow.WriteLine ("Enter Course:")
user ["Course4"]= Textwindow.Read()
Textwindow.WriteLine ("Enter Grade:")
user["Grade"]= Textwindow.Read()
Textwindow.WriteLine ("Enter credit points:")
user["points4"]= Textwindow.ReadNumber()

Textwindow.WriteLine ("Enter Course:")
user["Course5"]= Textwindow.Read()
Textwindow.WriteLine ("Enter Grade:")
user["Grade"]= Textwindow.Read()
Textwindow.WriteLine ("Enter credit points:")
user["points5"]= Textwindow.ReadNumber()

Textwindow.WriteLine ("Enter Course:")
user["Course6"]= Textwindow.Read()
Textwindow.WriteLine ("Enter Grade:")
user["Grade"]= Textwindow.Read()
Textwindow.WriteLine ("Enter Course:")
Textwindow.WriteLine ("Enter credit points:")
user["points6"]= Textwindow.ReadNumber()

Textwindow.WriteLine ("Enter Course:")
user["Course7"]= Textwindow.Read()
Textwindow.WriteLine (" Enter Grade:")
user["Grade"]= Textwindow.Read()
Textwindow.WriteLine ("Enter credit points:")
user["points7"]= Textwindow.ReadNumber()

Textwindow.WriteLine ("Enter Course:")
user["Course8"]= Textwindow.Read()
Textwindow.WriteLine (" Enter Grade:")
user["Grade"]= Textwindow.Read()
Textwindow.WriteLine ("Enter credit points:")
user["points8"]= Textwindow.ReadNumber()

Textwindow.WriteLine ("Enter Course:")
user["Course9"]= Textwindow.Read()
Textwindow.WriteLine (" Enter Grade:")
user["Grade"]=Textwindow.Read()
Textwindow.WriteLine ("Enter credit points:")
user["points9"]= Textwindow.ReadNumber()

Textwindow.WriteLine ("Enter Course:")
user["Course10"]= Textwindow.Read()
Textwindow.WriteLine (" Enter Grade:")
user["Grade"]= Textwindow.Read()
Textwindow.WriteLine ("Enter credit points:")
user["points10"]= Textwindow.ReadNumber()

For i= points1 To points10
sum= i + 1
EndFor
Textwindow.WriteLine("The sum of "+points1+" to "+points10+" is " +sum)
GPA=sum/40.0
GPA=Textwindow.ReadNumber()
Textwindow.WriteLine("The GPA of "+sum+" is" + sum)

If (GPA <2.0)Then
Textwindow.WriteLine ("Upgrade is needed to graduate:" + GPA)
elseif (GPA <=2.1) And ( GPA<=3.3) Then
Textwindow.WriteLine ("Class Credit:" + GPA)
If (GPA >=3.4) Then
Textwindow.WriteLine ("Class Distinction:" + GPA)
EndIf
EndIf

Textwindow.Write("What info do you want? ")

index = Textwindow.Read()
Textwindow.WriteLine(index + " = " + user[index])



Is This A Good Question/Topic? 0
  • +

Page 1 of 1