1,486 Answered Questions for the topic computer programming

Computer Programming Computer Science Computer Engineering

03/02/20

Constructors with overloading and with default parameters

Write a program to show that constructors follow the property of function overloading as well as default parameter. Also, show that in case of constructor also, default parameter may create problem... more
Computer Programming Computer Science Computer Engineering

03/01/20

Write a class in c++

Write a class definition for an order class for a nightclub that contains a table number, a servers name, and the number of patrons at the table. Include a private static data member for the table... more
Computer Programming Computer Science

03/01/20

Create a class in c++

Define a class named Movie. Include private fields for the title, year, and name of the director. Include three public functions with the prototypes void Movie::setTitle(string); , void... more
Computer Programming Computer Engineering

03/01/20

Write a class in C++

Create a class named Shirt that has the public data members collarsize and sleeveLength. Create a class named Pants that has the public data members waistSize and inSeam. Write a program that... more
Computer Programming Nested Loops ( Computer )

02/27/20

Write a program to print a pattern like

The pattern is like this : * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Computer Programming Computer Science Computer Engineering

02/25/20

Write a C++ program

Suppose you have to develop small software to assist the primary students. Write a program that will help an elementary school student learn multiplication. Use the rand function to produce two... more
Computer Programming Computer Science

02/22/20

How do I write this program into a text file

#include <iostream>#include <fstream>#include <string>#include <cstring>#include <cstdlib>#include <iomanip>using namespace std;// global declarations for... more
Computer Programming C++ Linked List

02/22/20

Why the last value appear in hexadecimal rather than decimal? c++

struct Node{ Node* next; int num;};int main(){ Node* ptr = new Node; ptr->num = 11; ptr->next = NULL; cout << ptr << " "; cout << &ptr->next << " "; cout... more
Computer Programming Computer Science

02/19/20

Which of the following functions are in cstdlib.h? Check all that apply

a) ispunct b) strlen c) toupper d) strcmp e) atol f) atof
Computer Programming Computer Science

02/19/20

Which of the following file access flags will create a file when an attempt is made to open a file that doesn't exist?

a) ios::trunc b) ios::out c) ios::in d) ios::app e) ios::ate f) ios::binary
Computer Programming Computer Science

02/19/20

Which of the following character functions will return a non-zero integer when a space is passed into the function? Check all that apply.

a) ischar b) isvalid c) isspace d) ispunct e) isprint f) isalnum
Computer Programming Computer Science

02/19/20

Which of the following C code segments is syntactically correct?

a) puts("How many red mana do you want to tap?"); scanf("%d", &rmana); b) printf("How many green mana do you want to tap?"); scanf("%i", gmana); c) scanf("How many blue mana do you... more
Computer Programming Computer Science

02/19/20

Which is true of both recursion and iteration? Check all that apply

a) both have a termination test b) both have high overhead costs c) both based on a control structure d) both could happen infinitely in theory e) both use repetition
Computer Programming Computer Science

02/19/20

Which error bits can be reset to zero by using the clear() function? Check all that apply.

a) ios::failbit b) ios::clearbit c) ios::badbit d) ios::hardfail e) ios::goodbit f) ios::eofbit
Computer Programming Computer Science

02/19/20

What type of recursion is illustrated below?

void Player4() { //Player 4's turn //... Player1(); } void Player3() { //Player 3's turn //... Player4(); } void Player2() { //Player 2's turn //... Player3(); } void... more
Computer Programming Computer Science

02/19/20

What is the output of the code segment below? Assume all necessary libraries have been included.

fstream train; train.open("TTR_Rules.txt", ios::in|ios::out); char ch; train.seekp(10, ios::beg); train.seekg(-2, ios::cur); train.seekp(10 + train.tellg() - 3); train.get(ch); cout... more
Computer Programming Computer Science

02/19/20

Identify the errors (syntax or logical) in the following code segment. Select all that apply.

char game[10]; getline(game, 9); if (game == "Zombicide") cout << game; a) declaration of the variable game b) checking the value of game c) using getline to read data for game d)... more
Computer Programming Python Programming

02/17/20

Help with Python Programming homework...

In volleyball, there are 5 matches in a game. My daughter’s volleyball league would like a program that will accept the number of points that each team scored in the 5 matches and print out the... more
Computer Programming Statistics Computer Gaming

02/17/20

How to apply the empirical rule (68–95–99.7 rule)

How to apply the empirical rule (68–95–99.7 rule) to the following scenario:I have spent a significant amount of time trying to do the impossible (i.e., mathematically beat a game with a negative... more
Computer Programming Algebra 1 Java

02/15/20

Help is needed writing a simple JAVA class to check to see if a year is a leap year

A student wrote to me asking for help writing a JAVA program to calculate leap year. The assignment specified that the year must be evenly divisible by 4, but not 100. However, years divisible by... more
Computer Programming Python

02/14/20

In Python how can I reformat list of words with correct commas and the word "and"?

A student asked for assistance with a Python assignment. She was provided with four lists: animalList1 = ['dog', 'cat', 'bird', 'tiger', 'lion', 'camel'] animalList2 = ['elephant', 'alligator']... more
Computer Programming Statistics Java Mean

02/12/20

Generate random numbers within a range with pre-defined sum

What if I want to generate random numbers within a range with a fixed sum?? For example: I want to generate 50 numbers between 50 - 100 but with a fixed sum of 4650 so that I would produce a mean... more
Computer Programming Math Science Computer Science

02/12/20

Does an adjacency matrix need to have equal rows and columns?

If it needs to be the same number of rows and columns, then why? If not, then why not?
Computer Programming Math Science Computer Science

02/12/20

Does an adjacency matrix need to have equal rows and columns?

If it needs to the same number of rows and columns, then why? If not, then why not?
Computer Programming Statistics Java Mean

02/12/20

How to generate random numbers with specific mean

Is there any formula that I can understand which will allow me to generate random numbers with a specific mean. I'm using java. Thanks

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.