Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need some help tranlating this program from Java to C#(Ubuntu) public class Lab3{ public static void main(String[] args){ int A[] = {1,2,3,4}; int B[]

i need some help tranlating this program from Java to C#(Ubuntu)

public class Lab3{ public static void main(String[] args){

int A[] = {1,2,3,4}; int B[] = {5,6,7}; int C[] = {8,9,10,11}; int count = 0;

System.out.println("A= {1,2,3,4}, B={5,6,7} C={8,9,10,11} ");

System.out.println("Form the function f and g ");

System.out.println("f: A -> B");

for (int i = 0; i < A.length; i++){ for (int j = 0; j < 1; j++){ System.out.printf("(%d, %d) ", A[i], B[j]); if (i >= 1){ B[j]++; } } }

for (int j = 0; j < 3; j++){ B[j] -= 3; }

System.out.println(" g: B -> C");

for (int i = 0; i < C.length; i++){ for (int j = 0; j < 1; j++){ System.out.printf("(%d, %d) ", B[j], C[i]); if (i >= 1){ B[j]++; } } }

System.out.println(" Find gof ");

for(int i = 0; i < 1; i++){ B[i] -= 3; }

for(int i = 0; i < A.length; i++){ count++; for (int j = 0; j < 1; j++){ System.out.println("(gof)" + "(" + count + ") = " + "g(f" + "(" + A[i] + ")) = " + "g" + "(" + (B[j]) + ") = " + C[i]); if (i >= 1){ B[j]++; } if (i >= 1){ C[i]++; } } }

System.out.println(" gof");

for (int i = 0; i < A.length; i++){ for (int j = 0; j < 1; j++){ System.out.printf("(%d, %d) ", A[i], C[j]); C[j]++; } }

for (int i = 0; i < 1; i++){ C[i] -= 3; } for (int i = 0; i < 1; i++){ count -= 4; } for (int i = 0; i < 1; i++){ B[i] -=3; }

System.out.println(" Find fog ");

for(int i = 0; i < C.length; i++){ count++; C[i]--; for (int j = 0; j < 1; j++){ System.out.println("(fog)" + "(" + count + ") = " + "f(g" + "(" + C[i] + ")) = " + "g" + "(" + (B[j]) + ") = " + A[i]); A[i]++; if (i >= 1){ B[j]++; } if (i >1){ C[i]++; } } }

for (int i = 0; i < A.length; i++){ for (int j = 0; j < 1; j++){ if (i == 0){ System.out.println(" fog"); } A[i]--; System.out.printf("(%d, %d) ", C[j], A[i]); C[j]++; } } } }

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

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

Describe the beliefs held in common by neobehaviorists?

Answered: 1 week ago

Question

Describe the seven standard parts of a letter.

Answered: 1 week ago

Question

Explain how to develop effective Internet-based messages.

Answered: 1 week ago

Question

Identify the advantages and disadvantages of written messages.

Answered: 1 week ago