Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

convert the code from JAVA to C public class Weekend { public static void main(String [] args) { Film Watch[] = new Film[4]; Watch[0] =

convert the code from JAVA to C

public class Weekend { public static void main(String [] args) { Film Watch[] = new Film[4];

Watch[0] = new Film("Shrek",133); Watch[1] = new Film("Up",117); Watch[2] = new Film("Beauty & The Beast",93); Watch[3] = new Film("Enigma",114);

Film Longest = null; Film Shortest = null; int longtime = 0; int shorttime = 0; for (int i=0; i < Watch.length; i++) { int mins = Watch[i].getminutes(); if (i == 0) { Shortest = Longest = Watch[i]; shorttime = longtime = mins; } else { if (mins < shorttime) { shorttime=mins; Shortest = Watch[i]; } if (mins > longtime) { longtime=mins; Longest = Watch[i]; } } } System.out.println("Longest film is " + Longest.getcalled() + " at " + longtime + " minutes"); System.out.println("Shortest film is " + Shortest.getcalled() + " at " + shorttime + " minutes"); } }

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

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions

Question

What are value-added activities? Value-added costs?

Answered: 1 week ago

Question

1. Discuss the potential legal issues that relate to training.

Answered: 1 week ago

Question

3. Design a program for preparing for cross-cultural assignments.

Answered: 1 week ago

Question

2. Develop a program for effectively managing diversity.

Answered: 1 week ago