Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

problem 1) Create a two dimensional array of structs which contain multiplication and division table of the rows and columns, starting at 1 instead of zero. This prevents us from causing a divide by zero error in the division table. The program needs to read the number of rows and columns from the user as command line arguments.

rows=atoi(argv[1]); cols=atoi(argv[2]);

For ex, if you run your program with these command line arguments, ./prog 5 5, then your program must create a 5 by 5 matrix of structs and assign multiplication table to the mult variable in the struct and the division of the indices to the div variable in the struct. The mult variable needs to be an integral type (holding integers) and the div variable needs to be a floating-point type (holding fractional values).

ex:

struct mult_div_values {
int mult;
float div;
};

Your program needs to be well modularized with short functions, including the main, with 15 or less lines of code each. This means you would have a function which creates matrix of structs given the m x n dimensions, mult_div_values** create_table(int m, int n). You need to have functions that set the multiplication values and division values, void set_mult_values(mult_div_values **table, int m, int n) and void set_div_values(mult_div_values **table, int m, int n). Then, call functions to print the tables.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M94861

Have any Question? 


Related Questions in C/C++

Write a c program that calculates and prints the average of

Write a C program that calculates and prints the average of two or more salaries entered by the user. The program should first prompt the user to enter the number of salaries to process (make sure: at least 2 salaries mu ...

Intro to programming in c assignmentsince this is the last

Intro to Programming in C Assignment Since this is the last assignment, there will be no late submission. All programs must be electronically submitted by 5:00pm on Tuesday, December 2nd with NO EXCEPTIONS in order to re ...

Assessment taskthis coursework will allow you to

Assessment Task: This coursework will allow you to investigate some of the issues involved in writing threaded programs. You are to write a series of simple programs in C/C++ that will run under Linux, to illustrate how ...

Assignmentwhen writing c programs include comments in your

Assignment When writing C++ programs include comments in your code, make the program readable by indenting, use meaningful variable and function names, and produce meaningful output. This assignment will be to write a te ...

Programming in c assignmentwrite a c program that computes

Programming in C Assignment Write a C program that computes and outputs the current age of the United States in days (you can use 1776 as theUS founding year). You don't have to worry about fractional years or leap years ...

The second portion instruction shown below which is the

The second portion (instruction shown below) which is the actual C++ program is needed by this Saturday. Write a C++ program that is menu-driven that allows for the following menu choices:Load an exam: Loading an exam sh ...

Writing a c code its a beginner level code design a class

Writing a C++ code, its a beginner level code. Design a class house that defines a house on a street. A house has a house number and an (x,y) location, where x and y are numbers between -10 and 10. the key member is plot ...

Cs 2410workshop make-up assignmentwrite a c program that

CS 2410 Workshop Make-Up Assignment Write a C++ program that will output to a file called output.txt EVERY 10 digit phone number from 713-000-0000 through 713-000-0998. These numbers MUST only contain an odd number of ev ...

Modules in c are called functions c programs are typically

Modules in C are called functions. C programs are typically written by combining user created functions as well as "pre-packaged" functions found in the C Standard Library. For instance, printf() is a function that is fo ...

Assignmentbullwrite the code for each lab

Assignment • Write the code for each lab assignment. • Submit the lab in a single zip file in the online course shell. The lab must contain all .cpp files, along with any additional files that may be necessary for your p ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro