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

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms". This assignment will contain two (2) Parts: Written Paper and Visual Basic Prototype. The Visual Basic Prototype is not included in the total page count but is included in the e..

  Visual basic programming discussion

The use of decision logic is one of the major concepts of computer programming. The decision takes your code from being sequential to one that can take various options based on the different conditions. Determine the method of coding that you would u..

  Ticketseller

Use Visual basic 2010Visual Basic,  TicketSeller. This assignment will contain two (2) Parts: Event Planning Document and Coding phase. You must submit both parts as separate files for the completion of this assignment. Remember, you are only to de..

  Data storage & "exception error trapping"

Discussion on Data Storage and  "Exception Error Trapping".

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms".

  The implementation of server side of the application

Implementation of dynamic content, server side (backend) and database for your web site using Microsoft Visual Studio 2012

  Need help building a vwd website

Need help building a VWD website. This website may not go live. I have little progress as a family tragedy has impeded my time for school.

  To develop a visual basic console application

The aim of the assessment is to develop a Visual Basic console application that performs a number of mathematical functions. The mathematics package will be menu driven, i.e. a number of options will be displayed, and the user will be able to input w..

  Program in basic which prompts user to input two integers

Write down the program by using Small Basic which prompts the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum).

  Develop vb-net application that includes arrays and loops

Develop a VB.NET application that includes arrays, loops, and IF statements to do the following. Your output must also display the number of applicant(s) being interviewed.

  Visual basic program to accept numeral values

Write a VISUAL BASIC program to accept numeral values of any unit, sum up the total, calculate the average, and then Output the result with a proper unit.

  Write a visual logic program to accept series of number

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.

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