All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
computer science
introduction java program
Questions and Answers of
Introduction Java Program
William Wingate runs a pizza-analysis service. For each pizza, he needs to record the following information:The name of the pizza company, which can consist of more than one wordThe diameter of the
Devise a structure declaration that describes a fish. The structure should include the kind, the weight in whole ounces, and the length in fractional inches.
Use enum to define a type called Response with the possible values Yes, No, and Maybe. Yes should be 1, No should be 0, and Maybe should be 2.
Write a program that requests the user to enter three times for the 40-yd dash (or 40-meter, if you prefer) and then displays the times and the average. Use an array object to hold the data. (Use a
Suppose ted is a double variable. Declare a pointer that points to ted and use the pointer to display ted’s value.
Suppose treacle is an array of 10 floats. Declare a pointer that points to the first element of treacle and use the pointer to display the first and last elements of the array.
Write a code fragment that asks the user to enter a positive integer and then creates a dynamic array of that many ints. Do this by using new, then again using a vector object.
Is the following valid code? If so, what does it print? cout << (int *) “Home of the jolly bytes”;
Declare a vector object of 10 string objects and an array object of 10 string objects. Show the necessary header files and don’t use using. Do use a const for the number of strings.
What’s the difference between an entry-condition loop and an exit-condition loop? Which kind is each of the C++ loops?
Write a program that requests the user to enter two integers.The program should then calculate and report the sum of all the integers between and including the two integers. At this point, assume
What would the following code fragment print if it were part of a valid program?int i;for (i = 0; i < 5; i++)cout << i;cout << endl;
What would the following code fragment print if it were part of a valid program? int j;for (j = 0; j < 11; j += 3)cout << j;cout << endl << j << endl;
Write a program that asks the user to type in numbers. After each entry, the program should report the cumulative sum of the entries to date. The program should terminate when the user enters 0.
What would the following code fragment print if it were part of a valid program?int j = 5;while ( ++j < 9)cout << j++ << endl;
Daphne invests $100 at 10% simple interest.That is, every year, the investment earns 10% of the original investment, or $10 each and every year:interest = 0.10 × original balanceAt the same time,
What would the following code fragment print if it were part of a valid program?int k = 8;docout <<" k = " << k << endl;while (k++ < 5);
You sell the book C++ for Fools. Write a program that has you enter a year’s worth of monthly sales (in terms of number of books, not of money).The program should use a loop to prompt you by month,
Write a for loop that prints the values 1 2 4 8 16 32 64 by increasing the value of a counting variable by a factor of two in each cycle.
Do Programming Exercise 5 but use a two-dimensional array to store input for 3 years of monthly sales. Report the total sales for each individual year and for the combined years.
How do you make a loop body include more than one statement?
Design a structure called car that holds the following information about an automobile: its make, as a string in a character array or in a string object, and the year it was built, as an integer.
Is the following statement valid? If not, why not? If so, what does it do? int x = (1,024);What about the following?int y;y = 1,024;
Consider the following two code fragments for counting spaces and newlines:// Version 1while (cin.get(ch)) // quit on eof{if (ch == ' ')spaces++;if (ch == '\n')newlines++;}// Version 2while
Write a program that uses an array of char and a loop to read one word at a time until the word done is entered.The program should then report the number of words entered (not counting done).A sample
How does cin>>ch differ from cin.get(ch) and ch=cin.get() in how it views input?
Write a program using nested loops that asks the user to enter a value for the number of rows to display. It should then display that many rows of asterisks, with one asterisk in the first row, two
Write a program that reads keyboard input to the @ symbol and that echoes the input except for digits, converting each uppercase character to lowercase, and vice versa. (Don’t forget the cctype
Write a program that reads up to 10 donation values into an array of double. (Or, if you prefer, use an array template object.) The program should terminate input on non-numeric input. It should
Carefully consider the following program:#includeusing namespace std;int main(){char ch;int ct1, ct2;ct1 = ct2 = 0;while ((ch = cin.get()) != '$'){cout << ch;ct1++;if (ch = '$')ct2++;cout
Write a precursor to a menu-driven program. The program should display a menu offering four choices, each labeled with a letter. If the user responds with a letter other than one of the four valid
Construct logical expressions to represent the following conditions:a. weight is greater than or equal to 115 but less than 125.b. ch is q or Q.c. x is even but is not 26.d. x is even but is not a
When you join the Benevolent Order of Programmers, you can be known at BOP meetings by your real name, your job title, or your secret BOP name. Write a program that can list members by real name, by
In English, the statement “I will not not speak” means the same as “I will speak.” In C++, is !!x the same as x?
Construct a conditional expression that is equal to the absolute value of a variable. That is, if a variable x is positive, the value of the expression is just x, but if x is negative, the value of
The Kingdom of Neutronia, where the unit of currency is the tvarp, has the following income tax code:First 5,000 tvarps: 0% taxNext 10,000 tvarps: 10% taxNext 20,000 tvarps: 15% taxTvarps after
Put together a program that keeps track of monetary contributions to the Society for the Preservation of Rightful Influence. It should ask the user to enter the number of contributors and then
Rewrite the following fragment using switch:if (ch == 'A')a_grade++;else if (ch == 'B')b_grade++;else if (ch == 'C')c_grade++;else if (ch == 'D')d_grade++;elsef_grade++;
Write a program that reads input a word at a time until a lone q is entered. The program should then report the number of words that began with vowels, the number that began with consonants, and the
Write a program that opens a text file, reads it character-by-character to the end of the file, and reports the number of characters in the file.
Consider the following code fragment:int line = 0;char ch;while (cin.get(ch)){if (ch == 'Q')break;if (ch != '\n')continue;line++;}Rewrite this code without using break or continue.
Showing 700 - 800
of 741
1
2
3
4
5
6
7
8