Your program should read the specifications of graphic objects from a text File provided by the user using the command line. Each graphic object starts with a letter indicating the type of the object (L: line, R: rectangle, or P: parallelogram), followed by the properties of the object (e.g. position (optional), length of a line, width and length for a rectangle, or base and height for a parallelogram). The next lines will define any operations applied to that object (e.g. moveTo 2 5, filled yes, filling +, draw). Each object description is terminated by a dashed line as shown in the sample below (Figure 2). Your program should read the details of each object, apply the requested operations, handle any exceptions might be raised, and finally show the entire canvas that has all the drawn objects. E objects.txt L 15 moveTo 2 4 draw moveTo 5 2 +++++ R 20 3 55 filled yes filling + draw +++++ +++++ +++++ P 10 6 draw

Question
Your program should read the specifications of graphic objects from a text File provided by the user using the
command line. Each graphic object starts with a letter indicating the type of the object (L: line, R: rectangle,
or P: parallelogram), followed by the properties of the object (e.g. position (optional), length of a line, width
and length for a rectangle, or base and height for a parallelogram). The next lines will define any operations
applied to that object (e.g. moveTo 2 5, filled yes, filling +, draw). Each object description is terminated by a
dashed line as shown in the sample below (Figure 2).
Your program should read the details of each object, apply the requested operations, handle any exceptions
might be raised, and finally show the entire canvas that has all the drawn objects.
E objects.txt
L 15
moveTo 2 4
draw
moveTo 5 2
+++++
R 20 3 55
filled yes
filling +
draw
+++++
+++++
+++++
P 10 6
draw
Expand
Transcribed Image Text

Your program should read the specifications of graphic objects from a text File provided by the user using the command line. Each graphic object starts with a letter indicating the type of the object (L: line, R: rectangle, or P: parallelogram), followed by the properties of the object (e.g. position (optional), length of a line, width and length for a rectangle, or base and height for a parallelogram). The next lines will define any operations applied to that object (e.g. moveTo 2 5, filled yes, filling +, draw). Each object description is terminated by a dashed line as shown in the sample below (Figure 2). Your program should read the details of each object, apply the requested operations, handle any exceptions might be raised, and finally show the entire canvas that has all the drawn objects. E objects.txt L 15 moveTo 2 4 draw moveTo 5 2 +++++ R 20 3 55 filled yes filling + draw +++++ +++++ +++++ P 10 6 draw

Expand

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Java

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Textbook: Digital Systems Chapter 8  Question/Problem 44 I'm not sure if I'm running the correct Que...

A: Click to see the answer

Q: Question # 5:   Define the importance of feasibility study. Is there any possibility of not opting f...

A: Most people ignore the fact of planning with specificity. We only consider rough estimates while pla...

Q: please provide some explanations to help me understand the topic (image).

A: Based on our rule, we should answer only the first question when multiple questions are posted. Plea...

Q: Convert the following C++ programs into Pep/9 assembly 1) #include Using namespace std; void minimu...

A: Given: #include <iostream> using namespace std;  void minimum (int i1, int i2)  {          if ...

Q: Write a C program, called msg.c, that reads messages from an input file (or stdin) and verifies whet...

A: #include <stdio.h>#include<string.h>#include<stdbool.h>bool foo(char msg[120]);boo...

Q: Write a program to do the following operations on a Binary Search Tree (BST) considering the inputs ...

A: // Tree traversal in C++ #include <iostream>using namespace std; struct Node {  int data;  str...

Q: Efficiency and Big-Oh Notation 2. Approximate the value of sum after the following code fragment, in...

A: int sum=0; for(int i=1; i<=n-3; i++){ for(int j=1; j<=n+4; j+=5){ for(int k=1; k<=n+4; k+=5...

Q: Scilab program for solving ordinary diffrential equation using ode package

A: It is numerically oriented high level programming language. It is free and open source software for ...

Q: Hello guys, Please i need a help in bash script (linux) ,if im allowed just to use nested ifs,  i wa...

A: Bash Script: while truedo    echo "Enter a number"    read num    if [ $num -eq 20 ]    then        ...

Q: Question-3 There are n number of students in a class. Assume a teacher enters and wants to shake han...

A: Solution is in Step 2.

Q: Code in C# (OOP Concept) Suppose that Fruit, Apple, Orange, GoldenDelicious, and McIntosh are define...

A: What is an instance(object):- (OVERVIEW) A class defines a type of object, but it is not an object i...

Q: computer science: theory of computation or automata theoryplease provide (step-by-step) explanations...

A: B->tB->fP->iQ->oR->(L->)

Q: Your friend Abiha has just received a computer. A computer carries Ubuntu Linux operating system. Sh...

A: System Software A type of software is the interface between application software and system, is call...

Q: Specify the register contents and flag status as the following instructions are executed. A B S Z CY...

A: flag Status TRUE  

Q: Write a program which compresses a given string of 1s and 0s and uncompress the string that was comp...

A: Note: Below is the required program in java language. Program Explanation: The code below asks a use...

Q: Suppose your one-button such that 'B’ or 'b’ of your keyboard is does not work correctly. If you typ...

A: import java.util.Scanner;//importing scanner class public class Main{ public static void main(String...

Q: Using for loop, write a program that accepts an integer from the user between 100 and 1000 and check...

A: Iam giving the Code in C language as you did not mention: #include <stdio.h>int main(){   ...

Q: Translate the following c++ code into pep9 assembly language #include using namespace std; int squ...

A: Converted Code:  _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@plt:  jmpq   *0x2fe2(%ri...

Q: p.s: see image for question.

A: #include <iostream>using namespace std;double findslope(double x1,double x2,double y1,double y...

Q: A typical hash function often consists of the following three steps: Group of answer choices hashing...

A: Click to see the answer

Q: Consider the following Scenario.Design a database for an airline. The database must keep track of cu...

A: The ask is to design a database for an airline, keeping track of customers and their reservations, f...

Q: u can consider graph as describe question .consider as ur own by given question description

A: The Bellman-Ford algorithm maybe thanks to finding single-source shortest paths during a graph withn...

Q: Compare 0-, 1-, 2-, and 3-address machines by writing programs to computeX = (A x B + C) / (D − E × ...

A: //Assemble Language Code 3 Address 2 Address  1 Address(ACCUMULATOR) 0 Address(STACK MACHINE) Loa...

Q: Amarillo Video Store is planning a promotional give-away for its long-standing customers. If the cus...

A: Decision Tree: It is a tree structure of various conditions that are considered to make a decision. ...

Q: Write a Java or C++ program that will display the given menu: A Simple Library System1. Add a Studen...

A: Actually, java is a object oriented programming language. It is a platform independent.

Q: North Hills College is a private college in a small Candyland town. The college has outgrown itscomp...

A: Answer: Features offered by the computerized screening system are as follows:  Based on various fac...

Q: Can i get question b a) Create a generic Map interface MyMap<K,V> that represents a Map struct...

A: -Importing required package -creating generic Map interface MyMap. -declaring method to add a key va...

Q: Hello! I am having trouble with my intro to JAVA course. I have basic understanding of it, I am fail...

A: //code: public class DemoProgram {  public static void main(String[] args) {  // TODO Auto-generated...

Q: Q2: Which of the following statements are equivalent? Which ones are correctly indented?

A: In the given statements, All statement contains Two if statement, One else if statement, and One el...

Q: 9.1: MonetaryCoinDesign and implement a class called MonetaryCoin that is derived from the Coin  cla...

A: Note: Below is the required program in java language. Program Approach: Creating class coin Declari...

Q: Create a CourseException class that extends Exception and whose constructor receives a String that h...

A: public class Course {private String department;private int courseNumber;private float credits;public...

Q: Problem 5 ( Suppose that your hash function resolves collisions using open addressing with double ha...

A: The, answer has given below;

Q: The intersection of two sets contains the list of elements that are common to both, without repetiti...

A: Intersection: Let A and B the two arrays that store the sets of A and B respectively and C be the ar...

Q: What is the benefits and drawbacks of using IPSec over other network security mechanism such as thos...

A: Advantages of IPSec 1. Network layer securityIPSec operates at layer 3, the network layer. As a resu...

Q: What is a firewall? What are the three types of Firewalls?

A: A firewall is a network security device that advising the incoming and outgoing network traffic and ...

Q: Two elements with identical keys should have the same hash code. Group of answer choices True False ...

A: The, answers has given below: