Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
9th Edition
ISBN: 9780134801346
Author: FELKE-MORRIS
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 6, Problem 4MC
Which of the following configures a class called side to float to the left?
- a. .side {left: float;}
- b. .side {float: left;}
- c. side {float-left: 200px;}
- d. .side {position: left;}
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
An n-sided regular polygon’s sides all have the same length and all of its angles have the same degree (i.e., the polygon is both equilateral and equiangular). Design a class named RegularPolygon thatcontains:■ A private int data field named n that defines the number of sides in the polygon.■ A private float data field named side that stores the length of the side.■ A private float data field named x that defines the x-coordinate of the center of the polygon with default value 0.
■ A private float data field named y that defines the y-coordinate of the center of the polygon with default value 0.■ A constructor that creates a regular polygon with the specified n (default 3),side (default 1), x (default 0), and y (default 0).■ The accessor and mutator methods for all data fields.■ The method getPerimeter() that returns the perimeter of the polygon.■ The method getArea() that returns the area of the polygon. The formula for computing the area of a regular polygon is Area = (n * s2) / (4 *…
Compilation error
Main. java:16: error: incompatible types: char[][] cannot be converted to char[]
String string - String.copyValuedf(grid):
Main. java:39: error: constructor CharGrid in class CharGrid cannot be applied to given types;
grid-
new CharGrid(nunRows, numCols);
required: int, int, char
found: int, nt
reason: actual and formal argunent lists differ in lenath
Note: Some messages have been simplified; recompile with-Xdiags:verbose to get full output
2 errors
Hide
Time limit: 8 seconds
Memory limit: 256 MB
1// YOUR CODE HERE
2 class CharGrid(
3 private char[]] grid;
4.
public CharGrid(int nunRows, int nunCols, char symbol){
61
for (int i 0; 1< numRows: i++){
for (int j e; j< numCols; j++)(
grid[i][j]- symbol;
8
10
11
12
13
String string String.copyValueof (grid):
14
15
C0verride
16
public String tostring() (
17
return string:
18
19)
20
21
22
23
Submit
Start over (reset)
Design a class named RegularPolygon that contains: An int data field named n that defines the number of sides in the polygon with defaultvalue 3. A double data field named side that stores the length of the side with default value 1. A double data field named x that defines the x-coordinate of the polygon’s center withdefault value 0. A double data field named y that defines the y-coordinate of the polygon’s center withdefault value 0. A no-arg constructor that creates a regular polygon with default values. A constructor that creates a regular polygon with the specified number of sides andlength of side, centered at (0, 0). A constructor that creates a regular polygon with the specified number of sides, lengthof side, and x-and y-coordinates. The accessor and mutator methods for all data fields. The method getPerimeter() that returns the perimeter of the polygon. The method getArea() that returns the area of the polygon. The formula for a regular polygon is n*s2
/4*tan(pi/4)…
Chapter 6 Solutions
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Ch. 6.4 - Prob. 1CPCh. 6.4 - Prob. 2CPCh. 6.4 - Prob. 3CPCh. 6.15 - Prob. 1CPCh. 6.15 - Prob. 2CPCh. 6.15 - Prob. 3CPCh. 6 - Prob. 1MCCh. 6 - Prob. 2MCCh. 6 - Prob. 3MCCh. 6 - Which of the following configures a class called...
Ch. 6 - Prob. 5MCCh. 6 - Prob. 6MCCh. 6 - Prob. 7MCCh. 6 - Prob. 8MCCh. 6 - Prob. 9MCCh. 6 - Prob. 11FIBCh. 6 - Prob. 12FIBCh. 6 - The ____________ is always transparent.Ch. 6 - Prob. 14FIBCh. 6 - Prob. 15FIBCh. 6 - Prob. 1AYKCh. 6 - Prob. 2AYKCh. 6 - Prob. 3AYKCh. 6 - Prob. 1HOECh. 6 - Prob. 2HOECh. 6 - Prob. 3HOECh. 6 - Prob. 4HOECh. 6 - Prob. 5HOECh. 6 - Prob. 6HOECh. 6 - Prob. 7HOECh. 6 - Prob. 8HOECh. 6 - Prob. 9HOECh. 6 - Prob. 10HOE
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Are reflex actions (such as flinching from a hot stove) rational? Are they intelligent?
Artificial Intelligence: A Modern Approach
Why might doctors and nutritionists be interested in a device like DietSensor?
Using MIS (10th Edition)
In Exercises 1 through 22, determine the output displayed in the text box or list box by the lines of code.
Introduction to Programming Using Visual Basic (10th Edition)
Computers process data under the control of sets of instructions called
Java How To Program (Early Objects)
The following C++ program will not compile because the lines have been mixed up. cout Success\n; cout Success...
Starting Out with C++ from Control Structures to Objects (8th Edition)
An online or hard-copy repository for all project correspondence, inputs, outputs, deliverables, procedures, an...
Essentials of Systems Analysis and Design (6th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- CREATE A FLOWCHART. Creating a Class in Python class Rectangle: #start Rectangle class def __init__(self, rectWidth, rectHeight):#initialise the data members self.width=float(rectWidth)#assign width for object self.height=float(rectHeight ) #set height for object def calculateArea(self):#calculateArea function to calaulte the area return self.width *self.height # height * width = area def calculatePerimeter(self):#calculatePerimeter function to calaulte the perimeter return 2*(self.width +self.height) # perimeter = 2 * (width * height)arrow_forwardThe Circle class inherits from the Shape base class. Circle overrides the display() function defined in the Shape base class. Which of the following will call the base class display function from the Circle display function? this->display() Shape::display() display() ::display()arrow_forward.arrow_forward
- Design a class named CustomerRecord that holds a customer number, name, and address. Include separate methods to 'set' the value for each data field using the parameter being passed. Include separate methods to 'get' the value for each data field, i.e. "return" the field's value. Pseudocode:arrow_forwardIntroduction In this project, you will complete a C++ class by writing a copy constructor, destructor, and assignment operator. Furthermore, you will write a tester class and a test program and use Valgrind to check that your program is free of memory leaks. Finally, you will submit your project files on GL. If you have submitted programs on GL using shared directories (instead of the submit command), then the submission steps should be familiar. In this project we develop an application which holds the information about a digital art piece. There are two classes in this project. • The Random class generates data. The implementation of this class is provided. It generates random int numbers for colors. To create an object of this class we need to specify min and max values for the constructor. The colors fall between 30 and 37 inclusively. The Art class generates random colors and stores the color values. You implement the Art class. An object of the Art class is a digital masterpiece.…arrow_forwardJAVA:arrow_forward
- Don't put incorrect code..arrow_forwardRectangle Object Monitoring Create a Rectangle class that can compute the total area of all the created rectangle objects using static fields (variables). Remember that a Rectangle has two attributes: Length and Width. Implement the class by creating a computer program that will ask the user about three rectangle dimensions. The program should be able to display the total area of the three rectangle objects. For this exercise, you are required to apply all OOP concepts that you learned in class. Sample output: Enter Length R1: 1 Enter Width R1: 1 Enter Length R2: 2 Enter Width R2: 2 Enter Length R3: 3 Enter Width R3: 3 The total area of the rectangles is 14.00 Note: All characters in boldface are user inputs.arrow_forwardPlease answer this in python Define a class in python named BoatRace that contains the following information about a Boat Race: race_name: string race_id: int distance: int racers: List of Boat objects Write a constructor that allows the programmer to create an object of type BoatRace with a race_name, race_id, list of racers objects, and distance. The constructor will only take in one parameter, a string representing the name of a CSV file. The file will have the following format: Each row will always have exactly two columns. The first row will always contain the name of the race. The second row will always contain the id number for the race. The third row will always contain the distance for the race. All remaining rows contain information about the boats involved in the race: the first column will be the name of the boat, and the second column is that boat’s top speed. For example, the race in the file below has two boats: The Fire Ball with top speed 12, and The Leaf with…arrow_forward
- Please create a java class that contains the following data attributes and methods: private int customerNumber - a unique number assigned to each customer private String firstName - the customer's first name private String lastName - the customer's last name private float balance - the customer's balance get/set Methods for each data attribute public String toString() - Special method to be used when printing a customer Record objectarrow_forwardmau Open Leathing inta... - The class has data members that can hold the name of your cube, length of one of the sides and the color of your cube. - The class has a constructor that accepts the name, length of one of the sides, and color as arguments and sets the data members to those values. - The class has the following methods to set the corresponding data member. setName(string newName) setSide(double newSide) setColor(string newColor) - The class has a method called getVolume() that returns the volume of the cube, calculated by cubing the length of the side. - The class has a method called volumelncrease(double newVolume) that receive the percent the volume should increase, and then the side to the corresponding value. i - For example, 2.5 indicates 2.5% increasing of the volume. So you take the current volume, increase it by 2.5%, and then find the cube root to calculate the new side length. You can use the built in function called cbrt, part of the math library, to find the cube…arrow_forwardHelp find the classes, how they are utilized and how many objects were created in this code provided by me Source is provided, mainmenu.cpp is the images. and mainmenu.h is also provided. Source.cpp #include <SFML/Graphics.hpp>#include "MainMenu.h"#include <time.h>#include <SFML/Window.hpp> using namespace sf; int N = 30, M = 20;int size = 16;int w = size * N;int h = size * M; int dir, num = 4; struct Snake{ int x, y;} s[100]; struct Fruit{ int x, y;} f; void Tick(){ for (int i = num;i > 0;--i) { s[i].x = s[i - 1].x; s[i].y = s[i - 1].y; } if (dir == 0) s[0].y += 1; if (dir == 1) s[0].x -= 1; if (dir == 2) s[0].x += 1; if (dir == 3) s[0].y -= 1; if ((s[0].x == f.x) && (s[0].y == f.y)) { num++; f.x = rand() % N; f.y = rand() % M; } if (s[0].x > N) s[0].x = 0; if (s[0].x < 0) s[0].x = N; if (s[0].y > M) s[0].y = 0; if (s[0].y < 0) s[0].y = M; for (int i = 1;i < num;i++) if…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY