Computer programming

posted by .

The code below is supposed to calculate the average for a student using 10 grades. It contains several errors. Rewrite the code using the correct naming conventions and turn in the full solution and discuss using this topic.


Dim arrGrades(10) as integer
Dim num,I, iAverage as Integer

For I = 1 to 10
Num = inputboxl(“Please enter a number”)
arrGrades(10) = num
next
iAverage = arrGrades(9) / 10

  • Computer programming -

    There are many programming languages. You're using Basic, which exists in many flavours. You may want to specify the name of the compiler (VB?) you're using.

    1. An average is generally a floating point number, so it should not be defined as an integer.
    2. Inputbox returns a string. You may want to convert it to an integer using CInt (or CDec)
    3. There is no variable to accumulate the total marks.
    4. Average is obtained by dividing the total by the number of marks (10).
    5. next I is better than next by trying to avoid nesting errors.
    6. There is no error trapping. For example, if the user types in an invalid number, there should be a check and have the user re-enter the value.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Computer Programming

    Can anyone give me a site that contains a C source code. it must be a game or something that I can copy the code. thanks
  2. computer science

    ineed help with c++. i am using code blocks and i have a problem with the compiler. when I run this code ¡é # include <iostream> using namespace std; int main() { cout<<"Hello World!"<<endl return(0); } this message …
  3. ethics

    Write a 1,750- to 2,450-word paper that formulates your personal code of ethics, using one of the major ethical frameworks as a guide. Include answers to the following questions: o In previous weeks, you examined the professional code …
  4. programming java language

    For faster sorting of letters, the postal service encourages companies that send large volumes of mail to use bar code denoting the ZIP code (see figure below). Student XXXX PO Box 34689 Jeddah 21478 KSA There are full height frame …
  5. Java Programming

    I'm new to Java and I'm not sure how to write the source code for this problem I got in class... Write a java program using the while and if statement that will accept ten student grades and that will display the sum of the grades, …
  6. programming

    create a c++ code that will set first the number of the student to be entered then get the name and their grades, After that display the name, grades & remarks of the student using arrays
  7. Computer Literary

    Which of the following is Not an example of debugging A)Looking for errors in programming code B)Fixing misspelled commands in programming code C)Solving faulty logic in programming code D)Upgrading to improve the programming code
  8. ICT (Programming)

    Based on the table below, Based on the table below, using a CASE structure to display the type of designation when a specific code is entered. CODE TYPE OF DESIGNATION L LECTURER S SENIOR LECTURER D DEAN A ADMINISTRATION (other code) …
  9. Programming C++ using Data Structure.

    In an academic institution, Student has its records. Each student has his/her profile such as id number, student name. The institution also keeps records of student grades in each subject. Student grades contains information subject …
  10. Ed Tech

    What does the code of conduct include? A. A secret code for internet users B. The conduct that should be used with a code C. A set of rules for behavior when using the internet D. A rule that tells you the code I think C Thanks!

More Similar Questions