Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

///////////////////////////////////////////////// - ask input and output file names - open input and output files ///////////////////////////////////////////////// - m = read size of first set - x

image text in transcribed

/////////////////////////////////////////////////

- ask input and output file names

- open input and output files

/////////////////////////////////////////////////

- m = read size of first set

- x = create array of size m

- read m values into x

/////////////////////////////////////////////////

- n = read size of second set

- y = create array of size n

- read n values into y

/////////////////////////////////////////////////

- p = read number of pairs

- u = create array of size p

- v = create array of size p

- read p pairs into u and v

/////////////////////////////////////////////////

- deciding one to one

- decide whether v has duplicate values

- if yes then not one to one

- otherwise one to one

- print result

/////////////////////////////////////////////////

- deciding onto

- decide whether each value of y is in v

- if yes then onto

- otherwise not onto

- print result

/////////////////////////////////////////////////

- deciding bijective

- if one to one and onto then bijective

- otherwise not bijective

- print result

/////////////////////////////////////////////////

///////// Java /////////

In the second part of the assignment, write a program that will decide whether a function is one to one, onto, and bijective. The input to the program is a file containing a function. The output of the program is a file containing the three decisions about the function. The input file contains the size of the domain, the elements in the domain, the size of the codomain, the elements in the codomain, the number of mappings in the function, and the list of mappings. The elements are positive integers with no duplicates and unordered. The pairs are unordered. The program asks the user for file names. one to one not onto 5 10 15 12 23 19 not bijective 8 80 15 20 29 10 45 50 30 5 12 45 19 30 10 80 23 10 15 29 Run your program with the given functions and decide whether they are one to one, onto, and bijective. Submit the results

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

Discuss the steps of a generic change project.

Answered: 1 week ago

Question

=+ a. How does this change affect the incentives for working?

Answered: 1 week ago