Skip to content
Snippets Groups Projects
Commit b6cf0162 authored by Siyu Lin's avatar Siyu Lin
Browse files

Conflict

parents 30ed304b 635442ab
No related branches found
No related tags found
No related merge requests found
Showing with 327 additions and 23 deletions
.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/3.png

478 B

.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/4.png

509 B

.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/5.png

283 B

.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/6.png

490 B

.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/7.png

568 B

<<<<<<< HEAD
#Cached timestamps
#Wed Apr 16 19:49:34 CDT 2014
=======
#Cached timestamps
#Wed Apr 16 07:46:29 CDT 2014
>>>>>>> c12de30ca0ac025ea5105efad25f1396c1ca060a
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.ui.texteditor.FindReplaceDialog_dialogBounds">
<item value="257" key="DIALOG_WIDTH"/>
<item value="335" key="DIALOG_Y_ORIGIN"/>
<item value="840" key="DIALOG_X_ORIGIN"/>
<item value="380" key="DIALOG_HEIGHT"/>
<item value="1|Segoe UI|9.0|0|WINDOWS|1|-12|0|0|0|400|0|0|0|1|0|0|0|0|Segoe UI" key="DIALOG_FONT_NAME"/>
</section>
<section name="org.eclipse.ui.texteditor.FindReplaceDialog">
<item value="true" key="wrap"/>
<item value="false" key="casesensitive"/>
<item value="false" key="isRegEx"/>
<item value="false" key="incremental"/>
<item value="false" key="wholeword"/>
<item value="stringToHideableChar" key="selection"/>
<list key="findhistory">
<item value="stringToHideableChar"/>
</list>
<list key="replacehistory">
</list>
</section>
</section>
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.ui.texteditor.FindReplaceDialog_dialogBounds">
<item value="263" key="DIALOG_WIDTH"/>
<item value="335" key="DIALOG_Y_ORIGIN"/>
<item value="399" key="DIALOG_HEIGHT"/>
<item value="840" key="DIALOG_X_ORIGIN"/>
<item value="1|Lucida Grande|11.0|0|COCOA|1|LucidaGrande" key="DIALOG_FONT_NAME"/>
</section>
<section name="org.eclipse.ui.texteditor.FindReplaceDialog">
<item value="true" key="wrap"/>
<item value="false" key="isRegEx"/>
<item value="false" key="casesensitive"/>
<item value="false" key="incremental"/>
<item value="false" key="wholeword"/>
<item value="" key="selection"/>
<list key="findhistory">
<item value="totalcards"/>
<item value="ranking"/>
<item value="stringToHideableChar"/>
</list>
<list key="replacehistory">
</list>
</section>
</section>
<<<<<<< HEAD
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="FileSystemImportWizard">
<item value="false" key="WizardFileSystemResourceImportPage1.STORE_OVERWRITE_EXISTING_RESOURCES_ID"/>
<item value="false" key="WizardFileSystemResourceImportPage1.STORE_CREATE_CONTAINER_STRUCTURE_ID"/>
<list key="WizardFileSystemResourceImportPage1.STORE_SOURCE_NAMES_ID">
<item value="/Users/siyulin/Downloads/hw3_skeleton/src/util"/>
<item value="/Users/siyulin/Downloads/hw3_skeleton/src/hw3"/>
<item value="/Users/siyulin/Downloads/hw3_skeleton/src/api"/>
<item value="C:\Users\siyul\Downloads"/>
<item value="S:\cs227\workspace\homework\src\hw2"/>
</list>
</section>
<section name="org.eclipse.ui.internal.QuickAccess">
<item value="800" key="dialogWidth"/>
<item value="500" key="dialogHeight"/>
<list key="orderedProviders">
</list>
<list key="textArray">
</list>
<list key="orderedElements">
</list>
<list key="textEntries">
</list>
</section>
<section name="ImportExportAction">
<item value="org.eclipse.ui.wizards.import.FileSystem" key="ImportExportPage.STORE_SELECTED_IMPORT_WIZARD_ID"/>
<list key="ImportExportPage.STORE_EXPANDED_IMPORT_CATEGORIES">
<item value="org.eclipse.ui.Basic"/>
</list>
</section>
</section>
=======
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="FileSystemImportWizard">
......@@ -28,3 +62,4 @@
</list>
</section>
</section>
>>>>>>> c12de30ca0ac025ea5105efad25f1396c1ca060a
File added
package mini1;
public class TV
{
public static final double VOLUME_INCREMENT = 0.07;
private int currentChannel;
private double currentVolume;
private int channelMax; //Setting the max of the channel numbers
private int channelMin;
private int previousChannel;
/*
** Constructor TV Constructs a new TV with available channels 0 through givenChannelMax - 1.
*/
public TV(int givenChannelMax)
{
channelMin = 0;
channelMax = givenChannelMax;
currentChannel = 0;
currentVolume = 0.50;
previousChannel = 0;
}
/*
** Method channelDown Changes the channel down by 1, wrapping around to channelMax - 1 if the current channel is zero.
*/
public void channelDown()
{
previousChannel = currentChannel;
if (currentChannel == channelMin)
{
currentChannel = channelMax-1;
}
else
{
currentChannel = currentChannel-1;
}
}
/*
** Method channelUp Changes the channel up by 1, wrapping around to zero if the current channel is channelMax - 1.
*/
public void channelUp()
{
previousChannel = currentChannel;
if (currentChannel == channelMax-1)
{
currentChannel = channelMin;
}
else
{
currentChannel = currentChannel+1;
}
}
/*
** Method getChannel()Returns the current channel for this TV.
*/
public int getChannel()
{
return currentChannel;
}
/*
** Method getVolume Returns the current volume for this TV.
*/
public double getVolume()
{
return currentVolume;
}
/*
** Method goToPreviousChannel Sets the current channel to the most recent previous channel.
*/
public void goToPreviousChannel()
{
if ((previousChannel == 0) && (currentChannel == 0))
{
System.out.println("ERROR"); //Alert if the channel has not been changed
}
else
{
int tempChannel = currentChannel; // Swap the previous channel and the current channel
currentChannel = previousChannel;
previousChannel = tempChannel;
}
}
/*
** Method setChannel(int number) Sets the channel to the given channel number
*/
public void setChannel(int number)
{
if (channelMax < number)
{
previousChannel = currentChannel;
currentChannel = Math.min(number-1, channelMax-1);
}
else if (channelMin > number)
{
previousChannel = currentChannel;
currentChannel = Math.max(number-1, channelMin);
}
else
{
previousChannel = currentChannel;
currentChannel = number;
}
}
/*
** Method volumDown Lowers the volume by VOLUME_INCREMENT, but not below 0.0.
*/
public void volumeDown()
{
currentVolume = Math.max(currentVolume - VOLUME_INCREMENT, 0.0);
}
/*
** Method volumeUp Raises the volume by VOLUME_INCREMENT, but not above 1.0.
*/
public void volumeUp()
{
currentVolume = Math.min(currentVolume + VOLUME_INCREMENT, 1.0);
}
}
package mini1;
public class TV
{
public static final double VOLUME_INCREMENT = 0.07;
private int currentChannel;
private double currentVolume;
private int channelMax; //Setting the max of the channel numbers
private int channelMin;
private int previousChannel;
/*
** Constructor TV Constructs a new TV with available channels 0 through givenChannelMax - 1.
*/
public TV(int givenChannelMax)
{
channelMin = 0;
channelMax = givenChannelMax;
currentChannel = 0;
currentVolume = 0.50;
previousChannel = 0;
}
/*
** Method channelDown Changes the channel down by 1, wrapping around to channelMax - 1 if the current channel is zero.
*/
public void channelDown()
{
previousChannel = currentChannel;
if (currentChannel == channelMin)
{
currentChannel = channelMax-1;
}
else
{
currentChannel = currentChannel-1;
}
}
/*
** Method channelUp Changes the channel up by 1, wrapping around to zero if the current channel is channelMax - 1.
*/
public void channelUp()
{
previousChannel = currentChannel;
if (currentChannel == channelMax-1)
{
currentChannel = channelMin;
}
else
{
currentChannel = currentChannel+1;
}
}
/*
** Method getChannel()Returns the current channel for this TV.
*/
public int getChannel()
{
return currentChannel;
}
/*
** Method getVolume Returns the current volume for this TV.
*/
public double getVolume()
{
return currentVolume;
}
/*
** Method goToPreviousChannel Sets the current channel to the most recent previous channel.
*/
public void goToPreviousChannel()
{
if ((previousChannel == 0) && (currentChannel == 0))
{
System.out.println("ERROR"); //Alert if the channel has not been changed
}
else
{
int tempChannel = currentChannel; // Swap the previous channel and the current channel
currentChannel = previousChannel;
previousChannel = tempChannel;
}
}
/*
** Method setChannel(int number) Sets the channel to the given channel number
*/
public void setChannel(int number)
{
if (channelMax < number)
{
previousChannel = currentChannel;
currentChannel = Math.min(number-1, channelMax-1);
}
else if (channelMin > number)
{
previousChannel = currentChannel;
currentChannel = Math.max(number-1, channelMin);
}
else
{
previousChannel = currentChannel;
currentChannel = number;
}
}
/*
** Method volumDown Lowers the volume by VOLUME_INCREMENT, but not below 0.0.
*/
public void volumeDown()
{
currentVolume = Math.max(currentVolume - VOLUME_INCREMENT, 0.0);
}
/*
** Method volumeUp Raises the volume by VOLUME_INCREMENT, but not above 1.0.
*/
public void volumeUp()
{
currentVolume = Math.min(currentVolume + VOLUME_INCREMENT, 1.0);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment