Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ program Create a table using a 40x5 array of doubles and make sure each colu

ID: 3574259 • Letter: C

Question

C++ program

Create a table using a 40x5 array of doubles and make sure each column has a title. Also have the program write the data to a text file. Use the same titles as the table below, the tables should look the same or at least very similar to each other. The numbers do not have to be the same. Remember this is a C++ program.

f (Hz) Vs p-p (V) | EXRVo p-p Theoc | ExpAv(dB) Av(dB 100 10 0.00482 0.00000 0.01926 0.00000 10 0.04321 0.00000 400 0.07653 0.00000 500 44 0.11 89y 0.13657 0.23024 0.27532 531 0.33535 0.41723 1000 9.375 0.45757 0.56057 2000 8.125 1.59701 1.80353 3000 6.875 301030 3.25455 4000 5781 443697 4.75994 5000 577236 6.02060 6000 4.375 6.989/0 778044 3.594 9.09080 888844 10000 10.83184 10.54780 20000 1.5 16.47817 30000 1.062 20.04321 19.47751 40000 0.8125 22.52313 21.80353 50000 0.6875 2445258 60000 0.5312 26.03144 -25.49484 80000 0.4062 28.52548 27.82520 100000 0.3438 3046148 29.27388 - 071354000 0000 7237354044 2-8 U000 5 3 2 5 559644 08 7-8 7 34453 0000_6 5 7 0 3 4 90000 3 7-1 6 0 5 5 2-8-8 47705927 001245-8 2 7 01-8 5 4 4 82482 00001 069-3579 OOOO-0 0 0 0 1 3 4-6 7-8 1122222 4113-8 26-1 3 9 4 5 7 107600 8-8 2-5 44 CO CL 2 5 9 2 3 5 0 3 9 378 OB 14332151 4936-8 0 5 7 706290 ed 0147-335913 37425326 h r( 0000-1 2 3 4 504 90 85054054 TA 0-0 0 0 0 0 0 0 1 3 4 569 060 4-6-8-0 11222223 4-8-1 5 5 5 1 549 55228 27-63 o) 00004 3727-8 7-9-6-5-6 1-8 3-0 4 8653-1-8 7 5359 86543 9999-8-6 5 43 0-0-0-0-0-0-0-0-0-0-0 |0-0-0-0-0-0-0-0-0-0-0 00 0000000 0000 00 0-0-0-0-0-0-0 0000000 0-0 1234578 1234568 0000000 5-6-00) T 2 3 1234568

Explanation / Answer

#include <stdio.h>
#include<conio.h>

int main(){
  
// PLEASE MAKE ENTRY IN ARRAY FOR 40 ROWS I HAVE ONLY INSERTED 8 ROWS AND CHANGE ROW IN TABLE TO 40 AND IN THE FOR LOOP ALSO. also u can change the extension of file
  
  
  


// fprintf (fp, " %s %s ", "ABC", "DEF");


float table[8][5] =
{
{100, 10, 10, -0.00482, 0},
{200, 10, 10, -0.01926, 0},
{300, 10, 10, -0.04321, 0},
  
{ 400, 10, 10,-0.07653,0 },
  
{ 500, 10, 9.844,-0.11899,-0.13657 },
{ 700 ,10 ,9.688,-0.23024,-0.27532 },
{ 850,10,9.531,-0.33535,-0.41723 },
{ 1000,10,9.375,-0.45757,-0.56057 },
  
  
  
  
  
  
  
  
  
};

FILE *fp;

fp = fopen("emp.txt", "ab+");
fprintf(fp,"| f(hz) | Vsp-p | expv0 | Theor | Expav ---------------------------- ");

for(int i = 0; i < 8; ++i)
{
  
for(int j = 0; j < 5; ++j)
{
if(table[i][j] > 9)
{
fprintf(fp," %f |", table[i][j]);
} else {
fprintf(fp," %f |", table[i][j]);
}
}
fprintf(fp," ---------------------------- ");
}
fclose(fp);
getchar();

return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote