Questions
What are the standard Python modules for handling standard output? How do you program reread data...

What are the standard Python modules for handling standard output?
How do you program reread data from standard input?
What happens when an exception is raised and the program does not handle it with a try/except statement?
What type of exception does a program raise when it tries to open a nonexistent file?
What type of exception does a program raise when it uses the float number to convert a non-numeric string to a number?
What important statement do you need to write in a program that uses the math module?

In: Computer Science

I am using NetBeans IDE Java to code and I am seeking comment to the code...

I am using NetBeans IDE Java to code and I am seeking comment to the code as well (for better understanding).

  1. Magic squares. An n x n matrix that is filled with the numbers 1, 2, 3, …, n2 is a magic square if the sum of the elements in each row, in each column, and in the two diagonals is the same value.

Write a program that reads in 16 values from the keyboard, displays them in a 4 x 4 array, and tests whether they form a magic square.

Example:

              16     3       2      13

               5      10     11     8

               9       6       7      12

               4       15    14     1

You need to test two features:

  1. Does each of the numbers 1, 2, …., 16 occur in the user input?
  2. When the numbers are put into a square, are the sums of the rows, columns, and diagonals equal to each other?

Hint: use a two-dimentional array.

  1. Implement a class Robot that simulates a robot wandering on an infinite plane. The robot is located at a point with integer coordinates and faces north, east, south, or west. Supply methods:

public void turnLeft()

public void turnRight()

public void move()

public Point getLocation()

public String getDirection()

The turnLeft and turnRight methods change the direction but not the location. The move method moves the robot by one unit in the direction it is facing. The getDirection method returns a string "N", "E", "S", or "W".

In: Computer Science

Use the Galton dataset from the mosaicData package in R STUDIO library(mosaic) Create a scatter plot...

  1. Use the Galton dataset from the mosaicData package in R STUDIO

library(mosaic)

  1. Create a scatter plot to show the relationship between height against father’s height (x=father, y=height)

  2. What relationship did you see? (Use comments to write in your R Markdown file)

  3. Separate your plot into facets by sex

  4. Add a regression line using the “lm” method to both of your facets

  5. Generate a box plot of height by sex.

  1. Use the RailTrail data from the mosaicData package

library(mosaic)

  1. Generate a scatter plot to show the relationship between the number of crossings per day volume against the high temperature that day

  2. Separate your plot to facets by weekday

In: Computer Science

How does Microsoft use product design and production engineering play in the reduction of the impact...

How does Microsoft use product design and production engineering play in the reduction of the impact of technology waste on the environment

In: Computer Science

C++ Description: You will write a program that reads students names followed by their final grade....

C++

Description: You will write a program that reads students names followed by their final grade. It will output the names and their grade, followed by the corresponding letter grade. It will also print the name of the students(s) with the highest grade

  • Student data will be stored in a struct called studentType which has 4 members:
    • fName
    • lName
    • score
    • letterGrade
  • Assume there are 20 students
  • Your main() function will only have variable definitions and function calls
    • You MUST have the following functions
      • readData
      • assignGrade
      • findHighest
      • printHighest

In: Computer Science

23. ASCII is a 7-bit code, while Unicode is a 16-bit code. True or False? Explain...

23. ASCII is a 7-bit code, while Unicode is a 16-bit code. True or False? Explain
24. Binary-coded decimal (BCD) can be used to store two decimal digits in one byte. True or False? Explain
25. Reed-Solomon codes can effectively deal with burst errors. True or False? Explain
26. Hamming Codes are used for __________ bit errors. Explain
27. Describe the Principle of Equivalence of Software and Hardware. What is the caveat to it? Explain

In: Computer Science

1. Write Python program that use a while loop to determine how long it takes for...

1. Write Python program that use a while loop to determine how long it takes for an investment to double at a given interest rate.

The input will be an annualized interest rate, and the output is the number of years it takes an investment to double.

Note: The amount of initial investment can be any positive value, you can use $1.

2. Write a function def DoubleInvest(initialInvest) to perform the same functionalities as question1. Make sure to include you main function for testing.

In: Computer Science

Write pseudocode algorithms for the programs described as follows:- Available Credits A program that calculates a...

Write pseudocode algorithms for the programs described as follows:- Available Credits A program that calculates a customer’s available credit should as the user for the following:  The customers maximum amount of credit  The amount of credit used by the customer Once these items have been entered, the program should calculate and display the customer’s available credit. You can calculate available credit by subtracting the amount of the credit used from the maximum amount of credit. (I need this in JAVA format please)

In: Computer Science

Using C# Design and implement a program (name it ProcessGrades) that reads from the user four...

Using C# Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below.

Sample run 1:

You entered:   95, 80, 100, 70

Highest grade:100

Lowest grade:  70

Average grade:86.25

In: Computer Science

Terrain navigation is a key component in the design of unmanned aerial vehicles (UAVs). Vehichles such...

Terrain navigation is a key component in the design of unmanned aerial vehicles (UAVs). Vehichles such as a robot or a car, can travel on land; and vehiches such as a drone or a plane can fly above the land. A UAV system contains an on board computer that has stored the terrain information for the area in which it is to be operated, Because it knows where it is at all times (often using a global positioning system (GPS) receiver), the vehicle can then select the best path to get to a designed spot. If the destination changes, the vehicle can refer to its internal maps and recompute the new path. The computer software that guides these vechicles must be tested over a variety of land formations and topologies. Elevvation information for large grids of land is available in computer databases. One way of measuring the "difficulty" of a lanad grid with respect to terrain navigation is to determine the number of peaks in the grid, where a peak is a point that has lower elevations all around it. For this problem, we want to determine whether the value in grid position [m] [n] is peak. Assume that the values in the four positions shown are adjacent to grid position [m] [n]

grid [m-1] [n]
grid [m][n-1] grid [m][n]    grid [m][n+1]
grid [m+1] [n]

Write a program in C PROGRAMMING that reads elevation data from a data file named grid1. txt. (this file you have to create and name it as grid 1.txt.) data as shown below which represent elevation for a grid that has 6 points along the side and seven points along the top ( the peaks have been highlighted and underlined):

5039 5127 5238 5259 5248 5310 5299

5150 5392 5410 5401 5352 5820 5321

5290   5560    5490 5421 5530 5831    5210

5110 5429 5430 5411 5459 5630 5319

4920 5129 4921   5821 4722 4921 5129

5023 5129 4822 4872 4794 4862 4245

Then prints the number of peaks and their locations. Assume that the first line of the data file contains the number of rows and the number of columns for the grid of information. These values are then followed by the elevation values, in row order. The maximum size of the grid is 25 rows by 25 columns.

Hints:

  1. Define and print the number of peaks and their locations in an elevation grid.
  2. input is a file containing the elevation data and the output is a listing of the location of the peaks.
  3. to specify the location of the peaks, you need to assign an addressing scheme to the data because you are going to implement this solution in c. Therefore, choose its 2D array subscripting notation.
  4. assume the top left corner is position [0][0], the row numbers increase by 1 as move down the page and the column numbers increase by 1 as move to the right.
  5. These peaks then occur at position[2][1], [2][5], and [4][3].
  6. To determine the peaks, compare a potential peak with its four neighbouring points.
  7. if all four neighboring points are less that the potential peak, then the potential peak is a real peak.
  8. the points on the edges of the array or grid cannot be potential peaks because do not have elevation information on all four sides of the points.

#Need solution c/c++ programmme

In: Computer Science

Hello I need this written in C# with a few comments thanks Modify the Patient class...

Hello I need this written in C# with a few comments thanks

Modify the Patient class to reference a demographic object that contains the patient phone number, email and next of kin. Create a demographic class to store this information. Make sure to create a constructor in the class for this information.

  1. Modify the Patient constructor to pass in this additional information at the time of instantiation.

  2. Modify the display method to display all the data

  3. HERE IS THE CODE

  4. using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;

    namespace Example2Aggregation

    {

        class Program

        {

            static void Main(string[] args)

            {

                Patient p1 = new Patient(1234, "Smith", "Jane", "O", "+");

                displayPatient(p1);

                Patient p2 = new Patient();

                p2.PatientId = 444;

                p2.LastName = "Doe";

                p2.FirstName = "John";

                BloodData b1 = new BloodData("A", "-");

                p2.BloodData = b1;

                p2.displayPatient();

            }

            //display method

            public static void displayPatient(Patient p)

            {

                Console.WriteLine("Patient ID: " + p.PatientId + " " + p.LastName +

                    " Blood Data: " + p.BloodData.BloodType + " " + p.BloodData.RhFactor);

            }

        }

    }



    PATIENT CLASS

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;


In: Computer Science

Use C++ to write a program that reads in a binary string from the command line...

Use C++ to write a program that reads in a binary string from the command line and applies the following (00, 1101) tag-system: if the first bit is 0, deletes the first three bits and append 00; if the first bit is 1, delete the first three bits and append 1101. Repeat as long as the string has at least 3 bits. Try to determine whether the following inputs will halt or go into an infinite loop: 10010, 100100100100100100. Use a queue.

In: Computer Science

. Dice rolling: In c++Write a program that simulates the rolling of two dice. The sum...

. Dice rolling: In c++Write a program that simulates the rolling of two dice. The sum of the two values should then be calculated. [Note: Each die can show an integer value from 1 to 6, so the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums.] The following table shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000,000 times. Use a onedimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also determine if the totals are reasonable (i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7).

In: Computer Science

Show the decimal integer 44 in 7-bit sign magnitude, one's complement, two's complement and excess-63 respectively...

Show the decimal integer 44 in 7-bit sign magnitude, one's complement, two's complement and excess-63 respectively in the given order, separated by comma.

In: Computer Science

In python: In many jurisdictions a small deposit is added to drink containers to encourage people...

In python:

In many jurisdictions a small deposit is added to drink containers to encourage people to recycle them. In one particular jurisdiction, drink containers holding one liter or less have a 0.10???????,??????????????????ℎ???????????ℎ??????????ℎ????0.10deposit,anddrinkcontainersholdingmorethanoneliterhavea0.25 deposit. Write a program that reads the number of containers of each size from the user as variables. Your program should continue by computing and displaying the refund that will be received for returning those containers.

In: Computer Science