Java Project Name: IC11_OCCLogo For this part of the in-class assignment, you ar
ID: 3848004 • Letter: J
Question
Java Project Name: IC11_OCCLogo
For this part of the in-class assignment, you are tasked to be a graphic designer for Orange Coast College. Your goal is to recreate the OCC logo (see below) inside of a Java Applet, so that 20 logos can be digitally printed to be transformed into vinyl graphics (used on soap dispensers, stickers, and bookstore merchandise).
The deadline is tight, so you need to do this quickly without hard-coding all 20 logos. Instead, you should create one logo and then use loops to accomplish the task of producing all 20.
Here is the current OCC logo (from Wikipedia):
_____________________________________________
my current code
________________________
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JApplet;
public class HackerChallenge extends JApplet{
/**
*
*/
private static final long serialVersionUID = 1L;
public void init()
{
setSize(1040,1040);
}
public void paint(Graphics canvas)
{
//lets define a for loop to print 5 circles going across
for(int row = 0; row <= 840; row += 210)
{
//lets define a nested for loop to print 4 circles going down
for(int col = 0; col <= 690; col +=180)
{
// orange
canvas.setColor(Color.ORANGE);
canvas.fillOval(row, col, 160, 160);
//white
canvas.setColor(Color.WHITE);
canvas.fillOval(row + 15, col + 15, 130, 130);
//blue
canvas.setColor(Color.BLUE);
canvas.fillArc(row + 20, col + 20, 120, 120, 60, 260);
// white
canvas.setColor(Color.WHITE);
canvas.fillOval(row + 45, col + 30, 85, 85);
//blue
canvas.setColor(Color.BLUE);
canvas.fillArc(row + 50, col +40, 75, 75, 70, 250);
// white
canvas.setColor(Color.WHITE);
canvas.fillOval(row + 60, col + 50, 65, 65);
// message
canvas.setColor(Color.BLUE);
canvas.drawString("Orange Coast College", row + 35, col + 170);
}
}
}
}
iew Safari Bookmarks Develop Bookmarks Develop Window Help Week 6: 3/5 3/ 32865.20163 Applet Viewer occuogowcass Applet Orange Coast College Orange Coast Colege Orange Coast Cole Orange Coast Colege orange Coast College Orange Coast Colege occ.blackboard.com Home I Chegg.com College Orange Coast College Orange Co College e Coast College College Coast College 51% Tue 5:03 PM Orange Coast C Orange Coast College Orange Coast C vascript er failed script pse anchez-3 ractice ct 2Explanation / Answer
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JApplet;
public class HackerChallenge extends JApplet{
/**
*
*/
private static final long serialVersionUID = 1L;
public void init()
{
setSize(1040,1040);
}
public void paint(Graphics canvas)
{
//lets define a for loop to print 5 circles going across
for(int row = 0; row <= 840; row += 210)
{
//lets define a nested for loop to print 4 circles going down
for(int col = 0; col <= 690; col +=180)
{
// orange
canvas.setColor(Color.ORANGE);
canvas.fillOval(row, col, 160, 160);
//white
canvas.setColor(Color.WHITE);
canvas.fillOval(row + 15, col + 15, 130, 130);
//blue
canvas.setColor(Color.BLUE);
canvas.fillArc(row + 20, col + 20, 120, 120, 60, 260);
// white
canvas.setColor(Color.WHITE);
canvas.fillOval(row + 45, col + 30, 85, 85);
//blue
canvas.setColor(Color.BLUE);
canvas.fillArc(row + 50, col +40, 75, 75, 70, 250);
// white
canvas.setColor(Color.WHITE);
canvas.fillOval(row + 60, col + 50, 65, 65);
// message
canvas.setColor(Color.BLUE);
canvas.drawString("Orange Coast College", row + 35, col + 170);
}
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.