Application to analyze exam results using files

Assignment Help Visual Basic Programming
Reference no: EM13748982

Objectives

At the end of this lab you should be able to:

- Learn how to open and close external (data) files.
- Use File Dialog boxes to locate files.
- Read data from input files and write data to output files (sequential data files)
- Understand the concept of fields and records in sequential files
- Read an entire line from a file (a record) and then breakdown into required fields.
- Use loops to read contents of data files.
- Use Try/catch blocks to handle file input/output errors.

Activity 1: An application to analyze Exam Results using files and arrays

Example: Figure below shows the contents of the file, marks.txt.

553_marks.png

Create an Open menu item under File menu item and program the following requirements under its click event handler.

- Use a FileOpenDialog dialog box to locate and get the file path for marks.txt (you can create this file using Notepad or Notepad++ and save it in you USB drive or to any other appropriate directory)

- Once file is selected, open it and using a loop read the entire contents of the file line by line, extracting name and mark and storing them in the names and midterm marks array.

You application will still require the following array (declared at either module/class level or procedure level - you have to decide), however without the initialization and size is set at 10.

Dim strNames(9) As String
Dim dblMarks(9) As Double

The rest of the program remains the same using a command button or a menu item that when clicked produces the following statistics as before, such as:

- Average mark
- Highest mark scored and the student who scored it. (* There are no ties)
- Lowest mark scored and the student who scored it (** There are no ties)
- The range (i.e. Highest score - lowest score)

Display the results appropriate labels on your form.

Activity 2: Investment application (writing results to a file)

Modify the Investment application so that it does the following:

Have a command button or menu item called "Print to File" (that the user can click after clicking the "Calculate" button or menu item) and under its click event handler:

- Use a FileSaveDialog dialog box to choose a location to save the contents of the results in the list box.

- Once the save to directory and filename (say Investment.txt) is chosen, open it and write the contents of the textboxes [initial investment amount, the percentage return on investment over the year and the number of years of the investment (duration)] each on a separate line. Then using a loop write the entire contents of the list box with each value on a separate line.

- The format of how the file contents should appear is given below:

Investment.txt - content

Initial investment: value of textbox for initial investment

% return on investment: value of textbox for % return

Investment period: value of textbox for duration

Year 1: first item in list box
Year 2: second item in list box
Year 3: third item in list box
:
:
:
Year N: last item in list box

Reference no: EM13748982

Questions Cloud

What religious freedoms and opportunitie were women afforded : What new religious freedoms and opportunities were women afforded due to the Protestant and Catholic reformations? Provide specific examples.
How many kilocalories of energy are obtained : If the density of gasoline is 0.66 g/mL , how many kilocalories of energy are obtained from 2.2 gal of gasoline?Express your answer using two significant figures.
Create a case study analysis focusing on the challenge : Create a case study analysis focusing on the company's challenge relative to strategic control through a balanced scorecard and implementation.
What is the available sales and purchase discount : What is the available sales/purchase discount? When would it be available? If the discount isn't taken, the invoice must be paid by which date?
Application to analyze exam results using files : An application to analyze Exam Results using files and arrays and Investment application.
How supply chain management affected the profitability : A brief explanation of how supply chain management affected the organization's profitability CSU requires that students use the APA style for papers and projects
How would you characterize maya government administration : How would you characterize the Maya government administration? Consider the way that Indian, Chinese, and Mongolian Empires administered their government
Exposing their personal assets to business liabilities : Bill and Darlene plan to go into business together. They anticipate losses in the first two or three years, which they would like to use to offset income from other sources. They also are concerned about exposing their personal assets to business lia..
Gross domestic product and interest rates : From the e-Activity, identify the most significant U.S. GDP results and trends for the most recent three-year period. Indicate the key factors that you believe have had an impact on the GDP increase or decrease. Provide support for your rationale.

Reviews

Write a Review

Visual Basic Programming Questions & Answers

  Write visual logic program to accept number til negative

Write a Visual Logic program which accepts a series of numbers, until the first negative value is entered. The maximum number of non-negative input values is 250.

  Gas pump - compute the total cost from the number of gallons

Write a program that will help an elementary school student learn multiplication and compute the total cost from the number of gallons entered and the selected grade.

  Visual basic application which inputs series of integers

Winner of a sales contest would input number of units sold by each sales person. Write down visual basic application which inputs series of 10 integers and finds and displays largest.

  Write windows forms application to simulate coin tossing

Write down the Windows forms application which simulates coin tossing. Let program toss coin each time user press the toss button.

  Effectiveness of the design and proposed program

Evaluate the overall design of the application and draw appropriate conclusions as to the effectiveness of the design and proposed program - Discuss and justify a means of representing the results of the calculations via an appropriate medium/objec..

  Why is the theory of charisma described as a double-edge

why is the theory of charisma described as a double-edge sword? please identify a leader that used charisma in a

  Write a program to request a positive integer

Continue this process until the number equals 1. Then display the number of repetitions the program required - write a program to determine when the world's population was under 6 million.

  Create a loan program

Create a program with the following forms - Financial Program is forml Investment form is form2

  Assignment onnbspvisual basic nbsptechnical project

assignment onnbspvisual basic nbsptechnical project designing vb applications across multiple platforms this assignment

  Gas pumpa gas pump calculates the cost of gas at a local

gas pumpa gas pump calculates the cost of gas at a local gas station. the station charges 2.69 per gallon for regular

  Wage calculator with tax calculations

Wage Calculator with Tax Calculations - Develop an application that calculates an employee's earnings

  Write a visual basic program to create an invoice

Write a Visual Basic program to create an invoice form for an order. (See the diagram below.) After the data on the left side of the form are entered, the user can display an invoice in a list box by pressing the Process Order button.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd