Create an items-for-sale web site. The following requirements must be met: 1. Th
ID: 2247160 • Letter: C
Question
Create an items-for-sale web site.The following requirements must be met:
1. The home page must have a link for a user to register with the site and a link to at least one category of items for sale.
2. The Register page must meet the following requirements:
2.1 It must be exactly as shown in the the example output, with the following exceptions: The word "coin" must be replaced by the name of your item for sale. The radio buttons and check boxes must be changed to make sense for your item.
2.2. The layout of each section must be achieved using a table (3 tables in all).
2.3. When its submit button is clicked, the form must post its data to: http://www.idocs.com/tags/cgi-bin/mycgi.pl
2.4. The zip code field must not allow more than 5 characters to be entered.
2.5. The page must include a hidden field named "hiddenField" that will post the value "hidden value".
2.6. The state field must have an initial selection of "Georgia". The posted data for states must be their 2-character abbreviation. For example, "GA" will post if Georgia was selected. You do not need to include every state. Include the first 12 states and an item that indicates there are more.
3. The items-for-sale page (Lincoln Cents in the example output) must meet the following requirements:
3.1. The table must include at least one small image for each item. The example output shows 2 image columns (front and back) for each item.
3.2. One of the columns must include a description of the item's condition.
3.3. One of the columns must contain a right-justified asking price.
3.4. The first column must contain a short name/code for the item. One of these must be a link that leads to a corresponding detail page for that item.
3.5 The first row must be a header row that uses a theme-appropriate background color.
4. The detail page (Detail - 1909-S VDB in the example output) must meet the following requirements:
4.1. The first row of the table must have 2 columns with a larger sized view of the item in each.
4.2. The second row must span both columns and must contain detailed information about the item.
4.3 After the table, the asking price and contact information must be present as shown in the example output.
5. Every page except the home page must have a breadcrumbs navigation area.
6. You may use "filler text" to fill out paragraphs as shown in the assignment example output. However, you must also have some specific, non-filler text.
Create an items-for-sale web site.
The following requirements must be met:
1. The home page must have a link for a user to register with the site and a link to at least one category of items for sale.
2. The Register page must meet the following requirements:
2.1 It must be exactly as shown in the the example output, with the following exceptions: The word "coin" must be replaced by the name of your item for sale. The radio buttons and check boxes must be changed to make sense for your item.
2.2. The layout of each section must be achieved using a table (3 tables in all).
2.3. When its submit button is clicked, the form must post its data to: http://www.idocs.com/tags/cgi-bin/mycgi.pl
2.4. The zip code field must not allow more than 5 characters to be entered.
2.5. The page must include a hidden field named "hiddenField" that will post the value "hidden value".
2.6. The state field must have an initial selection of "Georgia". The posted data for states must be their 2-character abbreviation. For example, "GA" will post if Georgia was selected. You do not need to include every state. Include the first 12 states and an item that indicates there are more.
3. The items-for-sale page (Lincoln Cents in the example output) must meet the following requirements:
3.1. The table must include at least one small image for each item. The example output shows 2 image columns (front and back) for each item.
3.2. One of the columns must include a description of the item's condition.
3.3. One of the columns must contain a right-justified asking price.
3.4. The first column must contain a short name/code for the item. One of these must be a link that leads to a corresponding detail page for that item.
3.5 The first row must be a header row that uses a theme-appropriate background color.
4. The detail page (Detail - 1909-S VDB in the example output) must meet the following requirements:
4.1. The first row of the table must have 2 columns with a larger sized view of the item in each.
4.2. The second row must span both columns and must contain detailed information about the item.
4.3 After the table, the asking price and contact information must be present as shown in the example output.
5. Every page except the home page must have a breadcrumbs navigation area.
6. You may use "filler text" to fill out paragraphs as shown in the assignment example output. However, you must also have some specific, non-filler text.
Create an items-for-sale web site.
The following requirements must be met:
1. The home page must have a link for a user to register with the site and a link to at least one category of items for sale.
2. The Register page must meet the following requirements:
2.1 It must be exactly as shown in the the example output, with the following exceptions: The word "coin" must be replaced by the name of your item for sale. The radio buttons and check boxes must be changed to make sense for your item.
2.2. The layout of each section must be achieved using a table (3 tables in all).
2.3. When its submit button is clicked, the form must post its data to: http://www.idocs.com/tags/cgi-bin/mycgi.pl
2.4. The zip code field must not allow more than 5 characters to be entered.
2.5. The page must include a hidden field named "hiddenField" that will post the value "hidden value".
2.6. The state field must have an initial selection of "Georgia". The posted data for states must be their 2-character abbreviation. For example, "GA" will post if Georgia was selected. You do not need to include every state. Include the first 12 states and an item that indicates there are more.
3. The items-for-sale page (Lincoln Cents in the example output) must meet the following requirements:
3.1. The table must include at least one small image for each item. The example output shows 2 image columns (front and back) for each item.
3.2. One of the columns must include a description of the item's condition.
3.3. One of the columns must contain a right-justified asking price.
3.4. The first column must contain a short name/code for the item. One of these must be a link that leads to a corresponding detail page for that item.
3.5 The first row must be a header row that uses a theme-appropriate background color.
4. The detail page (Detail - 1909-S VDB in the example output) must meet the following requirements:
4.1. The first row of the table must have 2 columns with a larger sized view of the item in each.
4.2. The second row must span both columns and must contain detailed information about the item.
4.3 After the table, the asking price and contact information must be present as shown in the example output.
5. Every page except the home page must have a breadcrumbs navigation area.
6. You may use "filler text" to fill out paragraphs as shown in the assignment example output. However, you must also have some specific, non-filler text.
Explanation / Answer
Hi..
import java.io.*; // For access to console I/O classes and methods
public class Calories
{
public static final double CALORIES_PER_GRAM = 9.0; // a gram of fat
// has 9 colories
public static void main (String[] args)
{
BufferedReader keyboard; // input stream
int gramsOfFat = 0, // number of grams of fat in one serving
totalCalories = 0; // number of calories in one serving
double fatFraction, // fraction of calories due to fat
percent; // percentage of total calories from fat
System.out.print("This program will tell you what percentage "
+ "of the calories in a serving "
+ "of a food are from the food's fat content. ");
/*
* Read input from the keyboard
*/
keyboard = new BufferedReader(new InputStreamReader(System.in));
System.out.print("How many grams of fat are in one serving? ");
try {
gramsOfFat = Integer.parseInt(keyboard.readLine());
} catch (IOException e) {}
System.out.print("How many total calories are in one serving? ");
try {
totalCalories = Integer.parseInt(keyboard.readLine());
} catch (IOException e) {}
/*
* Compute the percent of calories due to fat
*/
fatFraction = (gramsOfFat * CALORIES_PER_GRAM) / totalCalories;
percent = fatFraction * 100;
/*
* Pretty-print the input and results to the screen.
*/
if (gramsOfFat == 1) {
System.out.print(" A food with 1 gram of fat ");
} else {
System.out.print(" A food with " + gramsOfFat + " grams of fat ");
}
if (totalCalories == 1) {
System.out.print("and 1 calorie per serving ");
} else {
System.out.print("and " + totalCalories
+ " calories per serving ");
}
System.out.print("has " + twoPlaces(percent)
+ "% of those calories from fat. ");
}
public static double twoPlaces (double number)
{
double shiftRight, // number with . moved two places to the right
rounded, // shiftRight w/o extraneous digits
shiftLeft; // rounded with decimal point restored
shiftRight = number * 100;
rounded = Math.round(shiftRight);
shiftLeft = rounded / 100;
return shiftLeft;
}
}
thanks
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.