1,550 Answered Questions for the topic computer science
09/29/21
C++. Create a program that helps keeping track of song lists. Include code.
This program is an exercise in building, traversing, and destroying linear linked lists. The use of recursion should be included at least once in each assignment to better prepare us for future...
more
09/28/21
Next Fit Algorithm Help
def NextFit():
boxes = readCSV()
num_of_boxes = len(boxes)
bin_area = 40
n_bin = 0
area_remaining_in_bins = []
lists = []
for x in range(num_of_boxes):
...
more
Computer Science Programming
09/25/21
Insertion sort on a circularly linked list
public void InsertionSortLL() {
Node start = tail.next; //First element in the circular LL
Node temp = start.next; //Comparing node
Node curr = start;
Node prev = null;
...
more
09/25/21
Writing Unit test for mutator
Writing unit tests for mutators are only slightly different from that of constructors. The steps used are:
Create an object with initial values.
Call the mutator method that will change the...
more
09/25/21
Removing an element from a circular linked list
Here I have my code that deletes a given integer value from a circular linked list:
public void remove(int item){
Node temp = tail.next; //Refers to the first index
Node...
more
09/24/21
Circular Linked List: indexOf(int)Return the location fo the first occurrence of the value in the list. Return 0 if it is the first item. Return -1 if the item is not in the list.
So throughout my code I did not keep track of the size of the list. My code does add and deletes, but I was wondering how I could implement code where I don't necessarily need the size of the list...
more
09/23/21
Basic C++ Question
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service...
more
Algebra Chemistry Problem
A gold bar has a mass of 530,000 mg. The bar has a length of 5.2 cm a width of 2.1 cm and a density of 19.3 g/cm^3 Determine the height of the bar in millimeters. Show all work.
Computer Science
09/22/21
2.03 The Math Module
This assignment has three parts.Part One: Write an interactive program to calculate the volume and surface area of a three-dimensional object. Use the following guidelines to write your...
more
Computer Science Computer Programming
09/18/21
Change the Computer class to a struct. 1. Keep the default and non-default constructors 2. Your struct does not need the accessors and mutators since all variables are public by default.
3.Also Perforom the following:
Write a main():
- Create an instance of type Computer using the default constructor.
- Set the values for year, model, and purpose using any values you'd like.
-...
more
Computer Science Computer Programming
09/17/21
Create three separate files for this code: 1. Computer.h holds the class' declaration 2. Computer.cpp holds the class' functions' definitions 3. Main.cpp holds the test code (i.e. the main function)
#include <iostream>
#include <string>
using namespace std;
class Computer {
private:
int year;
string model;
string purpose;
public:
Computer(int y, string m, string m2)...
more
Computer Science Python
09/16/21
Write this task in a PyDev module named t01.py. Write and test a program that uses the formula f=9/5c+32 to convert a celsius temperature to fahrenheit
Where:
c: is a temperature in degrees celsius
f: is a temperature in degrees fahrenheit
Water freezes at 32 degrees fahrenheit
Both temperatures should be entered/displayed as integers.Ask the...
more
Computer Science Computer Programming
09/16/21
Boolean Expression Grammar
Write a grammar for Boolean expressions , assuming that we already have rules in our grammar for arithmetic expressions . Arithmetic expressions might be simple literals like 3 or 97 or may be...
more
09/16/21
Given the following method definitions for the Date class, identify the type of method (accessor or mutator),
Given the following method definitions for the Date class, identify the type of method (accessor or mutator), the return data type, if any, the explicit parameter data types, if any, and...
more
Computer Science
09/15/21
Generate a random 2-digit number.
Suppose you are writing a game-playing program that involves 2-digit numbers. First, generate a random 2-digit number. The user will try to guess this number in at most 10 attempts. While getting...
more
Computer Science
09/15/21
nested for loops statements
Use nested for loops statements to draw empty boxes of any character (user input). The boxes have the same number of rows and columns (user input - valid range: 5 to 21). Test for errors in input...
more
Computer Science Computer Programming
09/15/21
Draw a circuit for the following: A'+B*C'
09/13/21
why do so many calculators have different answers to "19(cos(38))"?
i tried six identical calculators and most said ≈14.97, but one said 18.14. google says 18.14, microsoft calculator says 14.97, desmos scientific says 14.97, desmos graph calculator says 18.14,...
more
Computer Science Discrete Math
09/12/21
monte hall question
Suppose you are a participant in a game show. You have a chance to win a motorbike. You are askedto select one of the 500 doors to open; the motorbike is behind one of the 500 doors; the other...
more
Computer Science
09/02/21
Create a C++ code that has these:
1. Create a class named Computer2. Add the following private member variables- an int variable named year- a string variable named model- a string variable named purpose3. Add the following public...
more
Computer Science
08/27/21
Compute, in centimeters and in meters, the height of a basketball player who is 6ft 2 in tall
08/24/21
Slove the code in C++ .Do not copy paste from net please.
#include <iostream> using namespace std; struct TreeNode { int data; TreeNode *left; TreeNode *right; }; class BinarySearchTree{ private: TreeNode* root; void insertNode(TreeNode *&tree,...
more
08/24/21
The table below represents a IS project set of activities, its expected completion time (weeks) and preceding activities.
Activity
Expected Time (weeks)
Preceding activities
A
5
None
B
4
None
C
10
A
D
8
B
E
14
B
F
6
C, D
G
7
D, E, F
H
3
F, G
a Draw a network diagram for the IS project...
more
Computer Science C++
08/23/21
Complete the C++
Answer must be in C++ format and using #include<iostream>a)Create a class called Student b)Declare a private data member: string name, int age, char genderc)Define a mutator and accessor...
more
08/23/21
Solve it in python
2) Implement a recursive algorithm which will print all the elements of a non-dummy headed singly linked linear list in reversed order.Example: if the linked list contains 10, 20, 30 and 40, the...
more
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.