1,475 Answered Questions for the topic computer programming

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
Computer Programming Computer General Computer Java

02/08/20

Java Programming Question: Intro to Computer Science

I'm working on a project for my computer science class in java and it is a travel agency. In one of the classes, Basket, I need to make an array of objects of type Reservation. But I also have to... more
Computer Programming Computer Science

01/30/20

Please!!!! help me write this program (Do not hold the auditorium in memory. Utilize random file access to view and modify the auditorium)

Adult - $10Child - $5Senior - $7.50Sample Theatre ABCDEFGHIJKLMNOPQRST 1 ...AA..CSSAC........ 2 ACSAACCA....AAAA..SS 3 .........AS......... 4 C.A.S.A.S.C.S.C.A.A. 5 AACACSSA.CCSSS.AAACC If... more
Computer Programming Computer Science

01/29/20

Can some help me fix my code

#include <stdio.h>#include <string.h>#include <stdlib.h>//include <conio.h>#define MAX_NAME_LENGTH (20)#define PW_INVALID_SIZE (1)#define PW_MISSING_UPPERCASE_LETTER... more
Computer Programming Computer Science

01/29/20

Please help me program this

C++Write a program that extracts and displays all vowels in a file.  Prompt the user for the filename of a text file. Read through the entire file and write every vowel to the output file.  Do not... more
Computer Programming Computer Science

01/26/20

Please help me program the two functions

Write the code using C Write a function that asks for the user's first, middle, and last names. The names will be entered by the user on a single line and will be stored in three different... more
Computer Programming

01/21/20

Which of the following is the best definition of risk profile

Computer Programming

01/18/20

computer networking

Why is it important to document the lines of a batch program and how might you do that and why should you document?
Computer Programming

01/15/20

i need help fast

who is responsible for ethics in a company?
Computer Programming

01/13/20

Consider a domain of size n = 5000. A: Generate random numbers in the domain [n] until two have the same value. How many random trials did this take? We will use k to represent this value.

Birthday Paradox Consider a domain of size n = 5000.A: Generate random numbers in the domain [n] until two have the same value. How many random trials did this take? We will use k to represent this... 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.