Which C++ class in the CS330Content folder has functionality to load and set textures for 3D scenes? Select one.
Added by Clara A.
Step 1
Let's think step by step. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 52 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Question 3) Maze (30%) You are going to design a program that loads a maze from a maze text file. The program then walks through the maze and finds the path from the starting node to the exiting node. Maze text file format: Number of linkers, Number of columns, number of rows (Header of maze) Node’s name, x position, y position, next linked node name, next linked node name ... Example: 22,7,6 START,0,2,B,A B,1,2,C,K C,1,3,D,E ... V,4,1,N,A EXIT,6,2,A,A Note: "A" is the same as null. It means there is no next linked node on this path (this path has no exit). "W" links to the exit. Your task is to write a program that: - Loads a maze text file (there are two text files) - Draws a maze on the panel (You are going to decide how to label the nodes). - Walks through the maze and finds the path from start to exit. - Highlights the path from start to exit and displays the path on the panel. - Displays the nodes' names of the path in order from "Start" to "Exit". - Provides a GUI. - Creates a jar file. There are two maze text files, so make sure your program works for both files. The FileManager class cannot be changed, but an additional class may be added. Here are the codes for FileManager. Please do not change any format unless it says so: public class FileManager { public String name; public int numberOfLines; public String[] lineData; public String data=""; public FileManager() { numberOfLines = 0; } public FileManager(String fileName) { this.name = fileName; numberOfLines = 0; File f = new File(name); try { Scanner myScanner = new Scanner(f); while(myScanner.hasNextLine()) { myScanner.nextLine(); numberOfLines++; } myScanner.close(); } catch(IOException e) { System.out.println("Cannot read the file" + e.getMessage()); } lineData = new String[numberOfLines]; } public void readFile(String fileName) { File f; if(fileName == null) f = new File(this.name); else f = new File(fileName); try { Scanner myScanner = new Scanner(f); int lineNum = 0; while(myScanner.hasNextLine()) { String line = myScanner.nextLine(); //System.out.println(line); lineData[lineNum] = line; data += line; lineNum++; } myScanner.close(); } catch(IOException e) { System.out.println("Cannot read the file" + e.getMessage()); } } public void writeFile(String fileName, String c) { File f; if(fileName == null) f = new File(this.name); else f = new File(fileName); try { f.createNewFile(); FileWriter writer = new FileWriter(f); writer.write(c); writer.flush(); writer.close(); } catch(IOException e) { System.out.println("Cannot write to the file" + e.getMessage()); } } } We need the Maze class to be done and the Panel class, which extends JPanel and draws the text file that gets read in. The Maze class is the running file. public class Maze { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here JFrame frame = new JFrame("Maze"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Panel panel = new Panel(); frame.add(panel); frame.setSize(700, 600); frame.setVisible(true); } }
Akash M.
Solutions should be coded in C++, using comments to describe what the code is doing. Task 1: Movie Profit Modify the Movie Data program to include two more members that hold the movie's production costs and first-year revenues. The constructor should be modified to allow these values to be set. Modify the function that displays the movie data to display the title, director, release year, running time, and first year's profit or loss. Also, improve the program by having the MovieData variables passed to the display function as constant references.
Madhur L.
Jerelyn N.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD