Concept explainers
Solution to
In this project you are to create a
Select from the following choices: 1. Add new book 2. Print listing sorted by author 3. Quit 1 Enter title: More Than Human Enter author: Sturgeon, Theodore Enter date: 1953 Select from the following choices: 1. Add new book 2. Print listing sorted by author 3. Quit 1 Enter title: Problem Solving with C++ Enter author: Savitch, Walter Enter date: 2015 Select from the following choices: 1. Add new book 2. Print listing sorted by author 3. Quit 2 The books entered so far, sorted alphabetically by author are: Savitch, Walter. Problem Solving with C++. 2015. Sturgeon, Theodore. More Than Human. 1953. Select from the following choices: 1. Add new book 2. Print listing sorted by author 3. Quit 1 Enter title: At Home in the Universe Enter author: Kauffman Enter date: 1996 Select from the following choices: 1. Add new book 2. Print listing sorted by author 3. Quit 2 The books entered so far, sorted alphabetically by artist are: Kauffman, At Home in the Universe, 1996 Savitch, Walter. Problem Solving with C++. 2015. Sturgeon, Theodore. More Than Human. 1953. |
Want to see the full answer?
Check out a sample textbook solutionChapter 18 Solutions
Problem Solving with C++ (10th Edition)
Additional Engineering Textbook Solutions
C How to Program (8th Edition)
Starting Out With Visual Basic (7th Edition)
Starting Out with Python (3rd Edition)
Modern Database Management
Starting Out with C++ from Control Structures to Objects (9th Edition)
Database Concepts (7th Edition)
- Computer Science JAVASCRIPT .xlsx parser I need to write a public class that reads an .xlsx file and returns an array of data in javascript. The array would be all of the data inside of the file. The file itself is going to be inside of a folder(downloadedFIles) inside of my project. So the public class will need to account for that.arrow_forwardStream : JAVA Tech Module :1 Project:1 Given the following table containing information about employees of an organization, develop a small java application, which accepts employee id from the command prompt and displays the following details as output: Emp No Emp Name Department Designation and Salary You may assume that the array is initialized with the following details: Emp Emp Join Date Desig Dept Basic HRA IT No. Name Code 1001 Ashish 01/04/2009 e R&D 20000 8000 3000 1002 Sushma 23/08/2012 PM 30000 12000 9000 1003 Rahul 12/11/2008 k Аcct 10000 8000 1000 1004 Chahat 29/01/2013 r Front 12000 6000 2000 Desk 1005 Ranjan 16/07/2005 m Engg 50000 20000 20000 1006 Suman 1/1/2000 e Manu 23000 9000 4400 factur ing 1007 Tanmay 12/06/2006 PM 29000 12000 10000 Salary is calculated as Basic+HRA+DA-IT. (DA details are given in the Designation table) Designation details : Designation Code Designation DA e Engineer 20000 C Consultant 32000 k Clerk 12000 r Receptionist 15000arrow_forwardWrite a program in Java, Python and Lisp When the program first launches, there is a menu which allows the user to select one of the following five options: 1.) Add a guest 2.) Add a room 3.) Add a booking 4.) View bookings 5.) Quit The functionality of these options is as follows: 1.) When users add a guest they provide a name which is stored in some manner of array or list. Guests are assigned a unique ID value where the first guest added is assigned the ID value 1, the second guest added is assigned the ID value 2 and so on. 2.) When users add a room they provide a room number and a room capacity (i.e. how many people can stay in the room at any one time) which is stored in some manner of array or list. Rooms have a property which indicates if they are booked or not for any given date – please see the Room Booking Dates section below for some guidance on the easiest way to implement this. 3.) When users add a booking they provide a guest ID, room number, the number…arrow_forward
- do both tasksarrow_forwardC++ Provide a different implementation of ChoiceQuestion. Instead of storing the choices in a vector, the add_choice function should add the choice to the question text. For this purpose, an add_line function has been added to the Question class. Complete the following file: choicequestion.cpp Use the following files: choicequestion.h #ifndef CHOICEQUESTION_H #define CHOICEQUESTION_H #include <string> using namespace std; #include "question.h" class ChoiceQuestion : public Question { public: /** Constructs a choice question with a given text and no choices. @param question_text the text of this question */ ChoiceQuestion(string question_text); /** Adds an answer choice to this question. @param choice the choice to add @param correct true if this is the correct choice, false otherwise */ void add_choice(string choice, bool correct); private: int num_choices; }; #endif question.h #ifndef QUESTION_H #define QUESTION_H #include <string> using namespace std; class Question {…arrow_forwardAssume numbers is a vector that contains these integers:2 4 6 8 10Then the following code executes:numbers. resize (9) :numbers. resize (11, 5) ;What does the vector contain now?O 11 1111 11 11 0 0 0 0 2 4 6 8 10000002468 10 5 502 4 6 8 10 0 0 0 0 11 11 11 11 1105500002468 100246810 000055Assume vec1 is a vector that contains these integers:10 20 30 40 50 60 70 80 90 100And vec2 is a vector that contains these integers3 6 9 12 15Then the following code executes:vecl.resize(7):vecl.swap (vec2) ;What do the vectors contain now?Cvec1 contains 3 6 9 12 15vec2 contains 10 20 30 40 50 60 70vec1 contains 3 6 9 12 15 0 0Ovec2 contains 10 20 30 40 50 60 70vec1 contains 3 6 9 12 15O vec2 contains 50 60 70 80 90 100vec1 contains 0 0 3 6 9 12 15O vec2 contains 50 60 70 80 90 100This code creates a compiler error.arrow_forward
- Project 5 - Magic Squares Objectives The objective of this project is to have students practice with two-dimensional arrays and loops. Specifications In this project, you will write code to determine if a two-dimensional array of ints is a Magic Square. For a two- dimensional array of ints to be a Magic Square all of the following must be true: 1. The array must be square - in other words, the lengths of all rows and all columns must be the same. 2. The array must contain all integers from 1 to n*n, where n is the length of the rows and columns. 3. The sum of the numbers in each diagonal, each row, and each column must be the same. You have been given two classes: • MagicSquareTest.java - Contains JUnit test cases for the MagicSquare class. Your code must pass all these tests. • MagicSquare.java - contains static methods to determine if a two-dimensional array of ints is a Magic Square: o isMagicSquare() - returns true if a two-dimensional array of ints meets all the criteria to be a…arrow_forwardSee attached images. Please help - C++arrow_forwardJava - Functions with 1D Arrays Create a program that asks the user for the size of an integer array and the elements of the array. Then, create a function called maxArray() with the following details: Parameters: An integer array The size of the integer array Return type - int Return value - the maximum value of the integer array Call the function you created in the main and pass the integer array and its size to it. Make sure to store the return value in a variable so you could print it afterwards. Input 1. First line contains the size of the array 2. Succeeding lines are the elements of an array 3. First line contains the size of the array 4. Succeeding lines are the elements of an array 5. First line contains the size of the array 6. Succeeding lines are the elements of an array 7. First line contains the size of the array 8. Succeeding lines are the elements of an array Output Enter size of array: 5 Enter element 1: 1 Enter element 2: 2 Enter…arrow_forward
- This assignment utilizes a class in an application that might be useful in the “real world.” It requires the sorting of, and computation with, data involving temperatures. Requirements: You are working for a meteorologist to maintain a list of temperatures and some related statistics for a month. Class and Data members: Create a class called Temperature that stores temperature readings (integers) in a vector (do not use an array). The class should have data members that store the month name and year of when the temperature readings were collected. Constructor(s): The class should have a 2-argument constructor that receives the month name and year as parameters and sets the appropriate data members to these values. Member Functions: The class should have functions as follows: Member functions to set and get the month and year variables. A member function that adds a single temperature to the vector. Both negative and positive temperatures are allowed. Call this…arrow_forwardCode Should Be in Java: use loops, if statements, arrays, scanner etc Write an application that stores at least five different college courses (such as CIS101), the time it first meets in the week (such as Mon 9 am), and the instructor (such as Johnson) in a two-dimensional array. Allow the user to enter a course name and display the corresponding time and instructor. If the course exists twice, display details for both sessions. If the course does not exist, display an error message. Save the file as TimesAndInstructors.javaarrow_forwardIn C Programming Write a main function that declares an array of 100 ints. Fill the array with random values between 1 and 100. Calculate the average of the values in the array. Output the average.arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT