Questions
FileWrite a program that will allow two users to play a tic-tac-toe game. You should write...


FileWrite a program that will allow two users to play a tic-tac-toe game. You should write the program such that two people can play the game without any special instructions. (assume they know how to play the game). You should code the program to do the five items below only. You do not have to write the entire program, just the five items below.
• Use a 2D array(3 rows, 3 columns) of datatype char. Initialize the 2D
array with a “ “(space) before the game starts.
• Prompt first player(X) to enter their first move.
(Enter row and column where they want to place their move)
• Then draw the game board showing the move. (see sample to the right)
• Prompt the second player(O) to enter their first move.
• Then draw the game board showing both moves. (see sample to the right)
For the purposes of this assignment, everything can be done in main….The assignment requirements stop here!
If you would like to program the entire game, you will need to:
1) Use a 2D array(3 rows, 3 columns) of datatype char. Initialize the 2D array with a “ “(space) before the game starts.
2) Test each move to see if that space is still available (a data validation loop should check the content of the array at the row and column entered by the user to see if an ‘X’ or ‘O’ is stored there….ask the user to keep entering row and column values until they enter numbers that do not have an ‘X’ or ‘O’.)
3) After each move, check to see if someone has won the game yet, if so, the game should end.
4) After 9 moves, if there is not winner declare a draw.
You can use a user-defined function named scanMove. scanMove should do the following:
• Will NOT return a value to main using a return statement. Should have parameters that include the 2D array, the turn number (so you know whether the player is ‘X’ or ‘O’. Player 1 should place an ‘X’, Player 2 will place a ‘Y’)
• Read in the row and column numbers of the box that the player would like to place their ‘X’ or ‘O’.
• Test each move to see if it’s a valid move (has the element already been used for an X or O?)
• Once you have a valid move, place the correct letter in the requested box.
You can use a user-defined function named drawBoard. drawBoard should draw the tic-tac-toe game board with ‘X’ and ‘O’ showing in the correct places. The board should look something like this:

In: Computer Science

In C Write a program that prompts the user to enter a Fahrenheit temperature calculate the...

In C Write a program that

  1. prompts the user to enter a Fahrenheit temperature
  2. calculate the corresponding temperature in Celsius and print it
  3. prompt the user if they want to do another temperature conversion
  4. if the user enters y, repeat 1), 2) and 3)
  5. if the user enters n, then print Bye and exit the program
  6. if the user enters any other character, ask the user to enter y or n only

Note : c = (5.0/9.0)*(f-32.0)

Sample output

Enter temperature in deg F

50

You entered 50 def F. The corresponding temp in deg C is 10.00

Another temperature conversion?

Enter y or n please

y

Enter temperature in deg F

60

You entered 60 def F. The corresponding temp in deg C is 15.56

Another temperature conversion?

Enter y or n please

a

Enter y or n please

#

Enter y or n please

y

Enter temperature in deg F

70

You entered 70 def F. The corresponding temp in deg C is 21.11

Another temperature conversion?

Enter y or n please

n

Bye

Problem 3

Write a program that

  1. prompts the user to enter a Fahrenheit temperature
  2. calculate the corresponding temperature in Celsius and print it
  3. prompt the user if they want to do another temperature conversion
  4. if the user enters y, repeat 1), 2) and 3)
  5. if the user enters n, then print Bye and exit the program
  6. if the user enters any other character, ask the user to enter y or n only

Note : c = (5.0/9.0)*(f-32.0)

Sample output

Enter temperature in deg F

50

You entered 50 def F. The corresponding temp in deg C is 10.00

Another temperature conversion?

Enter y or n please

y

Enter temperature in deg F

60

You entered 60 def F. The corresponding temp in deg C is 15.56

Another temperature conversion?

Enter y or n please

a

Enter y or n please

#

Enter y or n please

y

Enter temperature in deg F

70

You entered 70 def F. The corresponding temp in deg C is 21.11

Another temperature conversion?

Enter y or n please

n

Bye

In: Computer Science

1) Describe a real-world situation for which a for loop would provie an appropriate simulation. 2)...

1) Describe a real-world situation for which a for loop would provie an appropriate simulation.

2) Describe a real-world situation for which a while loop would be more appropriate.

3) How could a while loop be coded to run forever?

4) How could a for loop be coded to run forever?

5) Describe a testing strategy for ensuring that your loop conditions are properly coded.

*These are conceptual questions, I don't need any actual code. Please give me conceptual answers NOT CODE!

In: Computer Science

Prove  {0n1n, n≥0} is a computable language

Prove  {0n1n, n≥0} is a computable language

In: Computer Science

a)Adoubledata field(private)named realfor real part of a complex number. b)Adoubledata field(private)named imgfor imaginarypart of a complex...

a)Adoubledata field(private)named realfor real part of a complex number.

b)Adoubledata field(private)named imgfor imaginarypart of a complex number.

c)A no-arg constructor that creates a default complex number with real 0and img 0.

d)Auser-defined constructorthat creates a complex number with given 2 numbers.

e)The accessor and mutator functions for realand img.

f)A constant function named addition(Complex&comp1, Complex&comp2) that returns the sum of two givencomplex numbers.

g)Aconstantfunction named subtraction(Complex&comp1, Complex&comp2) that returns the subtractionof two givencomplex numbers.

h)A constant function named multiplication(Complex&comp1, Complex&comp2) that returns the multiplicationof two givencomplex numbers.

i)Write a test program that creates aComplexobject with no-arg constructor.Then, set -4.2 and 3.1to real and imaginary parts of the complex number, respectively.

j)Create another Complexobject using the user-defined constructor.

k)Testaddition, subtractionand multiplication functions using thesetwoComplex objects.

In: Computer Science

using c++ classes write program in which CString is used, and give simple and easy examples...

using c++ classes
write program in which CString is used, and give simple and easy examples in the form of program, to show how to use different CString function, use comments to explain what happened at that function.

In: Computer Science

An article describing the fresco School of Athens by the Renaissance painter Raphael is shown in...

An article describing the fresco School of Athens by the Renaissance painter Raphael is shown in Figure 2–56. Much of the HTML and CSS code has been created for you. Complete the web page design by adding the missing CSS styles.

Do the Following:

1.Go to the code2-3.html file and within the head section insert link elements linking the page to the code2-3_layout.css and code2-3.css files. Review the contents the files.

2.Open the code2-3.css file. For the html element, set the left padding space to 30 pixels and set the background color to the value hsla(40, 80%, 75%, 0.5).

3. Display all h1 and h2 headings in a Helvetica, Arial, or sans-serif font.

4. For all h1 headings:

  1. Set the font size to 3em,
  2. Set the line height to 1em, and
  3. Set the bottom margin to 0.

5. For all h2 headings:

  1. Set the top margin to 0,
  2. Set the font style to italic, and
  3. Set the font weight to normal.

6. For all inline images, set the top and right margins to 0, the bottom margin to 10px, and the left margin to 20px.

7. For all paragraphs, set the font size to 1.4em and set the text indent to 1em. For the first paragraph, using the first-of-type pseudo-class, set the text indent to 0. For the first line of the first paragraph, set the font variant to small-caps.

***Use the p:first-of-type::first-line pseudo-class and pseudo-element as the selector.***

Pages to be edited

Code2-3.css

@charset "utf-8";

/*

   New Perspectives on HTML5 and CSS3, 8th Edition

   Tutorial 2

   Coding Challenge 3

   Author:

   Date:   

   

   Filename: code2-3.css

*/

Code2-3.html

<!doctype html>

<html lang="en">

<head>

<!--

New Perspectives on HTML5 and CSS3, 8th Edition

Tutorial 2

Coding Challenge 3

Author:

Date:

Filename: code2-3.html

-->

<link href="code2-3_txt.css" rel="stylesheet" />

<meta charset="utf-8">

<title>Coding Challenge 2-3</title>

</head>

<body>

   <article>

      <h1>The School of Athens</h1>

      <h2>By Raphael</h2>

      <img src="code2-3_img.png" alt="School of Athens" />

      <p>The <em>School of Athens</em>, considered by many to be Raphael's

         masterwork, is a fresco representing the greatest minds of

         classical antiquity, gathered together to share their

         thoughts and beliefs. The fresco was painted between 1509 and 1511

         as a part of a commission to decorate the rooms of the

         Stanze di Raffaello in the Apostolic Palace in the Vatican.</p>

      <p>The two center figures, Aristotle and Plato, are key philosophers

         in the development of Western thought. Plato, with his belief in a

         higher realty, points skyward. Within his hands, Plato holds

         the <cite>Timaeus</cite> &mdash; one of Plato's famous dialogs on

         the nature of reality and time. In contrast, Aristotle points

         downward, indicating that he is grounded in a reality that can be

         experienced by sight and touch. In his hands, he holds his

         book <cite>Ethics</cite>, a tome that emphasizes the need for

         justice, friendship, and ethical government.

      </p>

      <p>Other famous philosophers fill the pseudo-architecture. In many cases,

         when Raphael did not have classical images to draw upon, he used

         images of contemporary figures to stand in for their classical

         counterparts. Look for a portrait of Michelangelo on the left-forward

         steps, his thoughts concerned with sketching and art.</p>

   </article>

</body>

</html>

In: Computer Science

***Need 200 words in total for the 3 question about LINUX below*** What is the syntax...

***Need 200 words in total for the 3 question about LINUX below***

  1. What is the syntax used to identify operating systems in the GRUB menu?
  2. What do the systemctl set-default graphical.target commands do?
  3. How does the multi-user.target file differ from the graphical.target file?

In: Computer Science

do the following in r studio Perform the Analysis of Variance of the grade point average...

do the following in r studio Perform the Analysis of Variance of the grade point average of the Design of Experiments subject . According to the following information. trat <- c (1,1,1,2,2,2,3,3,3,4,4,4) y <- c (7.66,6.98,7.80,5.26,5.44,5.80,7.41,7.33,7.04,3.51,2.91,3.66) trat <- as. factor (trat) data <- cbind (trat, y) y "is the dependent variable (grade point average) and the treatment is the variable" trat "is the type of test applied. Perform the following analyzes on the provided data:

1. Define the proposed experiment and identify the response variables, the factor, and the factor levels.

2. Perform exploratory data analysis

3. Indicate if there are outliers and if these would have an effect on the proposed experiment

4. Show graphically whether or not there is a difference of means for the treatment

5. Perform the ANOVA and write the null and alternative hypotheses, indicate the value of the statistic Contrast F and the critical value of F under the null hypothesis

6. Indicate the value of the mean square of the treatment, mean square of the error and square half total

7. Compare paired means and indicate whether there is a relationship between treatment and answer (Tukey's test)

8. Represent graphically the differences found and interpret the results 9. Based on your experiment, what would your conclusions be?

In: Computer Science

what is the cloud delivery models and cloud deployment models of Huawei Cloud Eucalyptus Salesforce Cloud...

what is the cloud delivery models and cloud deployment models of

Huawei Cloud

Eucalyptus

Salesforce Cloud

VMware Cloud

AWS

Google Cloud Platform

Microsoft Azure

Oracle Cloud

SAP Cloud

Rackspace

IBM Cloud

also what should you consider in order virtualising data centre? what services support this process from above providers

In: Computer Science

CP2 Major Project #1: Design a complete system according to the below requirements.. It Includes:1) A...

CP2 Major Project #1:

Design a complete system according to the below requirements.. It Includes:1) A Class called CandyOrder which stores information about the variety of the Candy (such as Snickers), the price per bag/box (such as 2.99), and the amount of bags/boxes (such as 2) ordered. The CandyOrder class should contain a constructor and a default constructor (sets variety to "Snickers", prices to $2.99, and box amount to 1). Accessor and Mutator methods for all instance variables. A toString method returning all instance variable values for thisobject.An equals method which returns true if variety and price are the same.---------------------------------------------------------------------------------------------------------------------

2) A Class called MasterOrder:

private CandyOrder[] orders; //required instance var /** Constructs a new MasterOrder object.

*/ public MasterOrder(int len) {//Constructs array orders (above) with len for length }

public boolean addOrder(int spot, String variety, int boxes, double price) {//create a new CandyOrder object and place in position spot in array orders//validate that spot in orders is null and that spot is not >= length of array orders//if validation fails, return false -- else return true}

public int getTotalBoxes() {//returns the total of amount of boxes in CandyOrder}

public double getTotalCost() {//returns the total cost of all of boxes in CandyOrder}

public CandyOrder[] removeVariety(String candyVar) { //removes any object from CandyOrder that has a variety of candyVar, new possible decreased array of CandyOrder (minus candyVars) returned }

public String printOutInfo() {//returns a combined string of all outputs in array orders using toString method in CandyOrder -- seperate each object by a newline---------------------------------------------------------------------------------------------------------------------

3) Main Driver Class:

a) prompt user for the length of the CandyOrder Array desired.

b) create a MasterOrder object passing the length from item a above

c) enter the amount of CandyOrders objects required in length via the addOrder method

d) call getTotalBoxes to printout total of all boxes

e) call getTotalCost to printout total cost of all CandyOrders in array

f) call removeVariety on a variety you have in the CandyOrder array in MasterOrder

g) call printOutInfo to printout all info in MasterOrder

In: Computer Science

Draw something interesting with JavaFX. The drawing must be something coherent - random shapes on the...

Draw something interesting with JavaFX. The drawing must be something coherent - random shapes on the canvas will not receive near full marks. Your drawing must make use of at least the following:

1) a compound object generated by a for loop

2) each of a rectangle, arc, circle, ellipse, line,

3) at least 15 shapes overall

4) 5 different colours

5) the use of translation, rotation, and scaling

In: Computer Science

What is the code (HTML) for the table (with a letter in each cell in definition...

What is the code (HTML) for the table (with a letter in each cell in definition order): has 10 columns with 7 rows.

In: Computer Science

Do in c++ programming languages Question 1: Solve the complete Question with all parts and subparts....

Do in c++ programming languages

Question 1: Solve the complete Question with all parts and subparts.

a) What do you understand by the term DATA TYPE?

b) Is it possible to replace for loop with a while loop. Justify your answer with reasoning and example.

c) Draw a flow chart for Do-While loop for controlled/uncontrolled infinite loop iterations.

d) Write down a function prototype that takes an array and its length as an argument and also return the same array by reversing the position of elements.

e) As you know that “the base address or the starting address of any array is its name”. Keeping this information, answer

i) Why the first index of any array always starts from zero. Although it points to the first location of an array.

ii) The reason why the last index is always one less than array length is “the first index starts from zero”. Does it seems to be a correct reason justify.

iii) What is the offset address of any array NAMED AS ARR1 who starting address is A011234h.

iv) Can you find the offset address of the 6th element of array given in 3? If its data type is INT. 5. What is the offset address of last element of an array stated in 3? If the length of array is 5 and data type is char.

Note: If you are not able to do complete question with parts and its subparts so kindly never do any single part ( i need complete question with proper answers.

In: Computer Science

Consider the design of a database for a web site of a web site of videos...

Consider the design of a database for a web site of a web site of videos that teach people how to do things by yourself, such as house renovation. We will call videos as DIY videos. First, all registered users can post DIY questions, such as “how to paint a wall”. Each DIY question is identified by a question ID, the question itself, and a list of tags (each tag is a lower case word) to annotate the question, and the date the question is posted,. For example, for the question “how to paint a wall”, we can add the tags “wall, paint, roller, brush”. A registered user can also post a DIY video (from the existing video website) to an existing DIY question. Each video is identified by a unique URL (use the URL when you click the share button at the video website page, a title and a description of the video, the date on which the video is posted to your database system. A registered user can search for videos by typing a question (ideally, support fuzzy search since a user might not be able to type the exact phrase in a question), all relevant video links will be returned as a list so that a user can click any video link in the result list to play that video. Each registered user is identified by a unique username, which must be an email, a password, a first name, a last name, the gender, and his/her birthday. A registered user can give at most one review for each video, but on a particular day, the user can post at most three videos. The review given by a user has a score of {“Poor”, “Fair”, “Good”, “Excellent”} and then a short remark. A user can also modify an existing review as well as deleting an existing review. Each user has a private favorite list of DIY videos(called my favorite DIYs). Each user can insert or delete a DIY video from that favorite list. When each video is shown, the DIY question will also be shown beside the title of the video, so that a user can click it to see other videos for this DIY question. While a video is on display, there is a button under the video called “Add to my favorite DIYs” so that a user can easily add this video to his/her favorite DIYs. The system has a distinguished user called “root” whose username is root (this is the only username that is not an email).

- Draw an E-R diagram for the system, in particular, use arrows or thick lines to represent constraints appropriately. Write down your assumptions and justifications briefly and clearly.

- Translate the above E-R diagram into a relational model, i.e., write a set of CREATE TABLE statements. In particular, specify primary key, foreign key and other constraints whenever possible.

In: Computer Science