Write a function called readfloatmap that reads

Assignment Help C/C++ Programming
Reference no: EM132432103

Write a function called readFloatMap that reads from a text file, stores its contents in a 2D array, and returns the number of lines it reads.

  • Your function should be named readFloatMap
  • Your function should take three parameters in the following order:
  • A string fileName
  • A 2D array of doubles with 4 columns double arr[][4]
  • The int number of rows of the given array
  • Your function will open and read the file specified by the fileName parameter. This string should include both the name and extension of the file (what type of file it is). There are some good and bad examples below:
  • Good: "books.txt"
  • Bad: "authors"
  • Your function should read the file line by line. Each line contains 4 floating point numbers which should be stored in the corresponding columns of the 2D array.
  • If your function has added any rows to the array (meaning that the specified file exists and could be read), it should return the number of rows added to the array.
  • If the file does not exist, return -1.
  • Your function does not print anything

Reference no: EM132432103

Questions Cloud

What is the estimated NPV of the project : What is the estimated NPV of the project if the after-tax cost of capital (discount rate) is 12%? Use the built-in NPV function in Excel
Define the terms Racism and the shifting political landscape : Define the terms Racism and the shifting political landscape,Public health and reducing disease and accidental death,Voting right and violence,Personal change
Implementations of fibonacci number program : Discuss the implementations of the Fibonacci Number program at the end of this section to consolidate the students' understanding of the while loop repetition
Compare two implementations of a priority queue : Compare two implementations of a priority queue whose highest priority element is the one with the smallest key value.
Write a function called readfloatmap that reads : Write a function called readFloatMap that reads from a text file, stores its contents in a 2D array, and returns the number of lines it reads.
What is the total compensation expense : The requisite service period is five years with 20% of the options vesting each year from 2017 to 2021. What is the total compensation expense
What is the goal of terrorism : Is ISIS an insurgency or a terrorist organization. Explian why? What is meant by "terrorism is just war by other means?"Describe the "duality" of terrorism.
Write a program to sort the student names : Write a program to sort the student's names (ascending order), calculate students' average test scores and letter grades (Use the 10 point grading scale).
Industry and market analysis for individual project firm : Reaching back to your competitor, industry and market analysis for your individual project firm, WHAT IS ITS SPECIFIC NICHE?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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