Question

In: Computer Science

VBA In this assignment you will create a Word Macro-Enabled Document. The document will contain procedures...

VBA

In this assignment you will create a Word Macro-Enabled Document. The document will contain procedures with the following declarations:

• Sub Main()

• Sub GetGrades(grades() As Integer, total As Integer)

• Sub CreateOutput(className As String, grades() As Integer, total As Integer)

The Main sub-procedure will be the macro that initializes the task. In this procedure you will declare all necessary variables, prompt the user to enter the name of the class and the number of students, resize the grades array appropriately, then make calls to each of the other procedures in the order they are listed at the beginning of these instructions.

The GetGrades procedure will use a loop to prompt the user for the grade for each student. Also within the loop a running total of all grades will be kept.

The CreateOutput procedure will create the output shown in the demo video linked below. Think about building a single string that contains all the output information. You can then assign that string to the Text property of the ActiveDocument Range. Use the built in

Solutions

Expert Solution

Dim sclass As String
Dim nos As Integer
Dim grades() As Integer
Dim total As Integer
Private Sub main()
sclass = InputBox("Please Enter Student Class", "Class")
nos = InputBox("Enter number of students")
ReDim grades(nos)
Call GetGrades(grades(), total)
Call CreateOutPut(sclass, grades(), total)
End Sub
Sub GetGrades(grades() As Integer, total As Integer)
For i = 1 To Val(nos)
grades(i) = InputBox("Enter grade")
total = total + grades(i)
Next
End Sub

Sub CreateOutPut(className As String, grades() As Integer, total As Integer)
MsgBox "ClassName is " & className & "Number of Students is " & nos & "Grades " & "Total " & total
End Sub


Related Solutions

create a document in microsoft word or excel document which has the following: Fictitious names and...
create a document in microsoft word or excel document which has the following: Fictitious names and addresses of 10 folks including name, address and phone number. Recreate the bike table, which includes bike name, part number and hourly rate Please limit your submission to no more than 2 pages.
Assignment Requirements Please complete all parts in a Microsoft Word document. The body of your document...
Assignment Requirements Please complete all parts in a Microsoft Word document. The body of your document should be at least 900 words in length. Quoting should be less than 10% of the entire paper. Paraphrasing is necessary. Students must cite and reference at least 4 credible sources from the Library. Instructions Imagine that you are an administrator for a large hospital. As part of your role within healthcare leadership, you are involved in several committees for the organization. For this...
This assignment must be completed on a Word Document and submitted. All questions related to the...
This assignment must be completed on a Word Document and submitted. All questions related to the case study must be answered completely in order to receive full credit. This case study assesses SLO #2: "On completion of this course, student will describe steps taken to prevent and manage medical emergencies in the dental office." You have just seated your patient to have a tooth prepared for a crown. It has already been a hectic morning and the dentist has urged...
Create a Word document that outlines how your ETL Process works. This document should be written...
Create a Word document that outlines how your ETL Process works. This document should be written as a technical support document that new hire can read to understand what the process does and technicians might use to troubleshoot the process. Include screen shots,
Javascipt Assignment: Create a document that includes a constructor function named Company in the document head...
Javascipt Assignment: Create a document that includes a constructor function named Company in the document head area. Include four properties in the Company object definition: name, products, motto, and numEmployees (for number of employees.) Instantiate a new Company object in the document body , then assign values to each of the properties Print the name, products, motto, and the numEmployees properties to the screen using document.write methods. Combine each printed property with a descriptive string. For example, when you print...
Submitting your assignment   1. Please collate your assignment as a single document in a Microsoft Word...
Submitting your assignment   1. Please collate your assignment as a single document in a Microsoft Word format. 2. Save the assignment as your candidate ID number, e.g. CON-000123456. 3. All marking is anonymous, which means your name should not appear on your work. 4. You must state which region/jurisdiction you are from in the header of each page. 5. You must ensure that all your work is properly referenced. 6. Penalties will be applied to those candidates who submit their...
Create a Word document and title it “College Expenses”. In the Word document, insert a table with at least 5 rows and 5 columns. Insert>Table.
Assignment 3 – Incorporating a Table into a Document.Create a Word document and title it “College Expenses”. In the Word document, insert a table with at least 5 rows and 5 columns. Insert>Table.Tell me about your college expenses you have by filling this table with subjects and data. Then write two paragraphs telling me about the information you provided in the table. Bold and color table heading.  Example of table:College ExpensesTuitionBooksComputer/InternetOther suppliesScience ClassMath classC.I.S. ClassEnglish ClassGive the page a proper title....
Read the assignment and answer the questions. You must also upload your Excel file, Word document...
Read the assignment and answer the questions. You must also upload your Excel file, Word document or pdf showing your work. Bodacious Building Co. is considering four different acquisition methods for obtaining pickup trucks. If the contractor’s MARR is 6%, which alternative do you recommend? The alternatives are: Immediate cash purchase of the trucks for $22,500 each, and after five years sell each truck for an estimated $4,900. Lease the trucks for five years for $4,000 per year paid at...
Identify the various tools that can be used to create a professional document in Microsoft Word....
Identify the various tools that can be used to create a professional document in Microsoft Word. Choose at least one of the tools which you would consider useful when creating your document.
Based on your understanding of the topic, create a report in a Microsoft Word document answering...
Based on your understanding of the topic, create a report in a Microsoft Word document answering the following questions: What are the benefits measuring the health status of individuals aged fifteen to sixty four years in a particular community or an entire population? What effect do these benefits have on the health status of the community or the entire population? Which one health statistic has had the most significant impact on the health care profession in the entire US or...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT