Questions
Discuss how the use of certain IT systems or technologies could make working or schooling from...

Discuss how the use of certain IT systems or technologies could make working or schooling from home easier and effective in this Corona Virus era.

In: Computer Science

[ RACKET] a) Write a recursive function (gen-list start end). This function will generate a list...

[ RACKET]

a) Write a recursive function (gen-list start end). This function will generate a list of consecutive integers, from start to end. If start > end then an empty list is generated.

For example: (gen-list 1 5) ---> (1 2 3 4 5)

b) write a recursive function pair-sum? that takes an integer sequence as generated by the gen-list function in exercise 4 above. This function tests whether any two adjacent values in the given list sum to the given val.

For example,

   (pair-sum? '(1 2 3) 3) ---> #t since 1+2=3. Similarly,

   (pair-sum? (gen-list 1 100) 1000) ---> #f since no two adjacent integers in the range 1 to 100 can sum to 1000.

You must use recursion, and not iteration. Please include explanation thanks.

In: Computer Science

Spring 2019 CMSC 140 Programming Project 4: Days Out Project Specifications Input for this project: the...

Spring 2019 CMSC 140 Programming Project 4: Days Out

Project Specifications

Input for this project:

  • the user must enter the number of employees in the company.
  • the user must enter as integers for each employee:
    • the employee number (ID)
    • the number of days that employee missed during the past year.

Input Validation:

  • Do not accept a number less than 1 for the number of employees.
  • Do not accept a negative number for the days any employee missed.
  • Be sure to print appropriate error messages for these items if the input is invalid.

Output: The program should display the following data:

  • Each employee number (ID) and the number of days missed should be written to the report file named "employeeAbsences.txt".
  • The average number of days a company's employees are absenting during the year should be written to the report file named "employeeAbsences.txt".
  • Create a global variable of type ofstream for the output file. Use this variable to open the fileemployeeAbsences.txt in your program to write data to it. A global variable is defined above the main function and its scope is throughout the program.
  • Create the following three functions that will be called by the main function:

         

  1. A function called NumOfEmployees. This function asks the user for the number of employees in the company. This value should be returned as an int. The function accepts no arguments (No parameter/input).
  2. A second function called TotDaysAbsent that accepts an arguments of type int for the number of employees in the company and returns the total of missed days as an int. This function should do the following:
    1. Asks the user to enter the following information for each employee:
  • The employee number (ID) (Assume the employee number is 4 digits or fewer, but don't validate it).
  • The number of days that employee missed during the past year.
    1. Writes each employee number (ID) and the number of days missed to the output file (employeeAbsences.txt). ( Refer to Sample File Output )
  1. A third function called AverageAbsent that calculates the average number of days absent.
    1. The function takes two arguments:
  • the number of employees in the company
  • the total number of days absent for all employees during the year.
    1. This function should return, as a double, the average number of days absent.
    2. This function does not perform screen or file output and does not ask the user for input.

In: Computer Science

JAVA PROGRAMMING Is there a way I can use a method to place a user input...

JAVA PROGRAMMING

Is there a way I can use a method to place a user input variable into an array? Then call the same method to print the array? I'm new to Java programming I'm not sure how to continue. For example:


import java.util.Scanner;

public class PartayScanner {

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

System.out.println("Enter pokemon 1:");
String pokemon1 = scan.nextLine();

System.out.println("Enter pokemon 2:");
String pokemon2 = scan.nextLine();

System.out.println("Enter pokemon 3:");
String pokemon3 = scan.nextLine();

System.out.println("Enter pokemon 4:");
String pokemon4 = scan.nextLine();

System.out.println("Enter pokemon 5:");
String pokemon5 = scan.nextLine();

System.out.println("Enter pokemon 6:");
String pokemon6 = scan.nextLine();

System.out.println("Here are your pokemon!");
System.out.println(pokemon1);
System.out.println(pokemon2);
System.out.println(pokemon3);
System.out.println(pokemon4);
System.out.println(pokemon5);
System.out.println(pokemon6);


In: Computer Science

Explain how Artificial Intelligence could be adopted in the lecture hall for IT101 to enable students...

Explain how Artificial Intelligence could be adopted in the lecture hall for IT101 to enable students have total concentration on the lecture and not to be distracted by anything else (such as putting down notes while the lecture is ongoing, etc.). Discuss, in detail, the components of such system(s) and how each component of such system(s) functions

In: Computer Science

In Java, how can I convert a string user input for example a student starts a...

In Java, how can I convert a string user input for example a student starts a uni degree in "Winter/2022", to a date type, and then once I have done that, add 3 years to that value, and changing the season, so for example Student Started: Winter/2022 and Student Finished: Summer/2025. Is there any possible way to do this?

Thank you.

In: Computer Science

Download the Unit 5 Programming Assignment When you're finished, upload the following to the Programming Assignment...

Download the Unit 5 Programming Assignment When you're finished, upload the following to the Programming Assignment submission area: Upload the following for your Programming Assignment submission. Question.java TrueFalseQuestion.java MultipleChoiceQuestion.java Quiz.java A screenshot showing a dialog box asking a true/false question Your assignment will be graded by your peers using the following criteria. Does the submission include a file that defines the class "Quiz" with a main method? Does the submission include a file that defines the abstract class "Question" with instance method "check", class method "showResults", and abstract method "ask"? Does the submission include a file that defines the class "MultipleChoiceQuestion" as a subclass of "Question" with an implementation of "ask" method? Does the submission include a file that defines the class "TrueFalseQuestion" as a subclass of "Question" with an implementation of the "ask" method? Does the class "TrueFalseQuestion" implement the method "ask" to keep asking its question until it receives an answer of "f", "false", "n", "no", "t", "true", "y", or "yes" in any combination of upper and lower case? Does the class "TrueFalseQuestion" implement the method "ask" to return only "TRUE" or "FALSE"? Does the class "TrueFalseQuestion" have a constructor that initializes the question and correct answer using its parameters, where the correct answer is initialized to only "TRUE" or "FALSE"? Does the main method in class "Quiz" use the "check" method with both "MultipleChoiceQuestion" and "TrueFalseQuestion" objects? Does the main method in class "Quiz" report correct results using the "showResults" method from class "Question"?

In: Computer Science

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