Questions
In Java Write a GUI that will let the user sample borders. Include a menu named...

In Java

Write a GUI that will let the user sample borders. Include a menu named Borders that offers three options—beveled border, etched border, and line border—as submenus with the following options:

• Beveled-border submenu options: raised or lowered.

• Etched-border submenu options: raised or lowered.

• Line-border submenu options: small, medium, or large. Each of these options should be a submenu with three color options: black, red, and blue. Put the borders around a label containing text that describes the border, such as Raised Border, Lowered Etched Border, and so forth. Fix the highlight and shadow colors for the etched-border options to whatever colors you like, and make the small line border 5 pixels wide, the medium one 10 pixels wide, and the large one 20 pixels wide.

In: Computer Science

In phyton, lab 5 info. def is_dna(one): sequence = input().upper() valid_dna = "ACGT" sequence = sequence.replace("...

In phyton, lab 5 info.

def is_dna(one):
sequence = input().upper()
valid_dna = "ACGT"
sequence = sequence.replace(" ", "")

for i in sequence:
if i in valid_dna:
count = 1
else:
count=0
if count==1:
print("This is a valid DNA sequence.")
else:
print("This is an invalid DNA sequence")

5
def is_valid(dna):
for one in dna:
if not is_dna(one):
return False
return true
print(is_valid("AGCTAGCAAGTCTT")) #prints true
print(is_dna("ACGTTGGC")) #prints false

1. Write a function called 'transcribe' that takes a DNA sequence as an argument. Return the transcribed RNA sequence. For example, if the DNA sequence is: tagtacta Then the transcribed RNA sequence should be: uaguacua Write a program to prompt the user to enter a DNA sequence and validate the sequence using the function you wrote in lab 5 and display the transcribed RNA sequence. 2. Write a function called 'revcom' that takes a DNA sequence as an argument. Return the reverse complement of the DNA sequence. For example, if the DNA sequence is: tagtacta The the reverse complemented DNA sequence is: tagtacta Write a program to prompt the user to enter a DNA sequence and validate the sequence using the function you wrote n lab 5 and display the reverse complemented sequence. 3. Create a list called 'verbs' and populate it with 6 or more of your favourite verbs (work safe!) Print the list of verbs one verb per line using a for loop and again with a while loop.

In: Computer Science

Implement a solution java solution for creating two writer threads and four reader threads

Implement a solution java solution for creating two writer threads and four reader threads

In: Computer Science

Problem: Charity Gala (gala.c) Many charities support good causes, but one of the difficulties each of...

Problem: Charity Gala (gala.c)

Many charities support good causes, but one of the difficulties each of them has is organizing their fundraising events. You've decided that you'd like to donate your skills to create a program that organizes the typical activities at a fund-raising gala. In particular, your program will help manage the following:

1) Ticket sales

2) Silent Auction

3) Raffle

Your program will log the number of tickets sold both in advance and at the event, a silent auction for donated items, and a raffle for other donated items.

Program Details

Ticket Sales Details

You will sell tickets in advance and at the door. Prices for buying in advance and at the door will be given. Also, the total number of tickets sold in advance will be given. Each guest will have a unique number. If there are n tickets sold in advance, then these guests will be numbered 0 through n-1. As the event starts, requests to buy tickets at the door may be made and these guests will be numbered sequentially, starting at the lowest unassigned number. The maximum number of guests will be 1000.

Silent Auction Details

The silent auction will have up to 1000 items. At any time, users can bid on any item, so long as the new bid exceeds the previous bid. At the point in time when the auction is closed, the items with at least one bid are given to the users who have placed the highest bid on that item. Your program must always keep track of all of the best bids on items so that no matter when the auction closes, you'll have all the data for who has won all of the items. Any item without a bid goes to no one.

Raffle Details

There will be a given number for the total number of raffle tickets sold, that will be 1000 or fewer. Guests can buy raffle tickets for a set price of $2.00. There will be a number of prizes awarded from the raffle (not to exceed 100) after the raffle has finished. For each raffle ticket, you'll have to keep track of which guest has it. The raffle tickets will be numbered starting at 0 through the number of tickets minus one. After the raffle finishes, you will be given the raffle numbers pulled for the winners of each prize. You will be guaranteed that these numbers correspond to numbers that were previously handed out during the raffle. You must determine who wins each prize.

Information for each event is provided from a file. You will take in input from the file and produce output for each event that occurs, in order.

A skeleton of the solution for this assignment is posted on the webcourse. You must fill in the functions that are currently empty. After you write each function, you should test it before moving on. The main function should not be modified for the final submission (you may modify it during testing, as long as you return it to its initial form).

Descriptions of each function are given in the skeleton along with the function Pre- and Post-conditions. The output sample on the webcourse shows the wording you should use and how the program should run when completed. Points are allotted for following the precise wording shown.

Input Specification

The first line of the file contains the following three values, separated by spaces:

Cost of the presales tickets (in dollars), Cost of the tickets at the door (in dollars), and the number of presale tickets. The first two values will be positive real numbers to two decimal places and the last will be a positive integer.

The second line of the file will contain one positive integer representing the number of auction items.

The third line of the file will contain the two following positive integers pertaining to the raffle: the number of raffle tickets available and the number of raffle prizes.

The fourth line of the file will contain a single positive integer, numEvents, representing the number of events that occur at the fundraising event. These events are split into two groups: actions by guests at the ball and awards given (raffle, auction, person, totalrevenue). All of the actions precede all of the awards.

The following numEvents lines will contain information about each event that occurs, with one event or award described for each line.

You will produce exactly one line of output for each event described. Here are the formats of each event that could occur:

If a patron buys a ticket at the door, a command will be on a line by itself:

BUY TICKET k

where k is a positive integer indicating the number of tickets bought at the door. These guests will be numbered as previously mentioned. You are guaranteed that the total number of tickets bought, including presales, will not exceed 1000.

If a patron makes a bid in the silent auction, a command of the following form will be issued:

BIDITEM k p d

where k represents the item number for which the bid is being placed, p represents the number of the person placing the bid, and d represents the dollar amount the person has bid. This last value is a positive real number to two decimal places while the others are non-negative integers within the appropriate ranges.

The following command closes the auction. Any bids made after this command is executed are ignored.

CLOSEAUCTION

If a guest desires to buy raffle tickets, a command with the following format will be used:

BUY RAFFLE k p

This command lets person p buy exactly k raffle tickets. The raffle tickets are numbered as previously described, so long as the tickets are still available. If they aren't available, the person gets whatever tickets remain.

The last several commands in the file will deal with awarding prizes. These commands will take the following forms.

A query about a raffle item will be of the following form:

AWARD RAFFLE i t

where i is the raffle item being given out and t is the number of the winning ticket of that raffle item. Your program will have to respond with the winner of this item. You will be guaranteed that this query will appear EXACTLY once for each raffle prize and that all queries of this form will appear AFTER the last raffle ticket is sold. Furthermore, you are guaranteed that the raffle ticket number was purchased by an individual and that the raffle prize number is valid. Finally, a single raffle ticket will correspond to at most one raffle prize.

A status query about a silent auction item will be of the following form:

AWARD AUCTION i

where i represents the silent auction item being queried. Your program will have to respond with the winner of this item and the amount they paid for it OR that there were no bids for that item.

The final status query in the file will be the following line:

TOTAL REVENUE

Output Specification

For the input command of the form:

BUY TICKET k

output a single line of the form:

SOLD TICKETS a - b

where a is the starting number of the tickets sold and b is the ending number (inclusive) of the tickets sold. If k is 1, then a and b will be equal. (Note: For the very first command of this type, the value of a will equal the number of presold tickets, since the presale tickets are numbered from 0 to the total number of presale tickets minus 1.)

For the input command of the form:

BIDITEM k p d

output a single line with one of the following forms:

BIDITEM k ACCEPTED for PERSON p at d DOLLARS

BIDITEM k REJECTED for PERSON p at d DOLLARS

The two reasons to reject a bid are if the new bid is not higher than the previous bid OR if the auction has been closed already.

For the CLOSEAUCTION command, simply print a single line with the exact same output:

CLOSEAUCTION

For the input command

BUY RAFFLE k p

output a single line of one of the two following forms:

RAFFLE TICKETS a - b given to PERSON p

NO RAFFLE TICKETS given to PERSON p

where a represents the first raffle ticket number issued and b represents the last raffle ticket number issued to person p. If there are no more raffle tickets left with the command is issued, the latter format is used. Note that the former format may be used if the person asks for a certain number of raffle tickets, but gets fewer since she bought all that were left.

For the input command

AWARD RAFFLE i t

output a single line of the following format:

RAFFLE i WON BY PERSON p

where i is the raffle item in question (in the query) and p is the number of the guest who won the item.

For the input command

AWARD AUCTION i

output a single line of the following format:

AUCTION ITEM i WON BY PERSON p for $d.dd

where i is the number of the auction item, p is the person who won the item and d.dd is the number of dollars he paid for it, to two decimal places. Or, if there are no bids for the item, output a single line of the following format:

NO BIDS FOR AUCTION ITEM %d

For the input command

TOTALREVENUE

output a single line with the following format:

TOTALREVENUE is $d.dd

where d.dd is the total amount gained by the event via ticket sales, auction sales, and raffle ticket sales. (We are assuming that all items were donated so that there was no cost associated with the event.

/*Header Comment
*/

#include <stdio.h>
#include <string.h>

//Constants to be used.
//MAXSIZE is the maximum size of all strings
//MAXAUCTIONITEMS is the maximum number of items in the auction
//MAXRAFFLE is the maximum number of available raffle tickets
#define MAXSIZE 100
#define MAXAUCTIONITEMS 1000
#define MAXRAFFLE 1000

//Function prototypes - do not change these
void initRaffle(int raffles[MAXRAFFLE]);
void initAuction(float auction[2][MAXAUCTIONITEMS]);
void buyTickets(float * totalRevenue, int * ticketsSold, int numTickets, float price);
void buyRaffle(float * totalRevenue, int raffles[MAXRAFFLE], int availTickets, int numTickets, int person);
void bid(float auction[2][MAXAUCTIONITEMS], float bid, int auctionNumber, int person, int flag);
float awardAuction(float auction[2][MAXAUCTIONITEMS], int auctionNumber);
void awardRaffle(int raffles[MAXRAFFLE], int raffleNumber, int winner);

//Main function
int main() {
FILE * ifp;
char filename[MAXSIZE], event[MAXSIZE], item[MAXSIZE];
float presale, dayOf, totalRevenue = 0;
float auctions[2][MAXAUCTIONITEMS];
int raffles[MAXRAFFLE];
int numPresale, numAuctions, numRaffle, numPrizes, numEvents;
int i, ticketsSold = 0, auctionFlag = 1;

printf("Please enter the input file name.\n");
scanf("%s", filename);

ifp = fopen(filename, "r");

fscanf(ifp, "%f%f%d", &presale, &dayOf, &numPresale);

totalRevenue += numPresale * presale;
ticketsSold = numPresale;

fscanf(ifp, "%d", &numAuctions);
fscanf(ifp, "%d%d", &numRaffle, &numPrizes);
fscanf(ifp, "%d", &numEvents);

initRaffle(raffles);
initAuction(auctions);

for (i=0; i<numEvents; i++) {
fscanf(ifp, "%s", event);

if (strcmp(event, "BUY") == 0) {
fscanf(ifp, "%s", item);
if (strcmp(item, "TICKET") == 0) {
int numTickets;
fscanf(ifp, "%d", &numTickets);
buyTickets(&totalRevenue, &ticketsSold, numTickets, dayOf);
}
else if (strcmp(item, "RAFFLE") == 0){
int numTickets, person;
fscanf(ifp, "%d%d", &numTickets, &person);
buyRaffle(&totalRevenue, raffles, numRaffle, numTickets, person);
}
}
else if (strcmp(event, "BIDITEM") == 0) {
int itemNumber, person;
float amount;
fscanf(ifp, "%d%d%f", &itemNumber, &person, &amount);
bid(auctions, amount, itemNumber, person, auctionFlag);
}
else if (strcmp(event, "CLOSEAUCTION") == 0) {
printf("CLOSE AUCTION.\n");
auctionFlag = 0;
}
else if (strcmp(event, "AWARD") == 0) {
fscanf(ifp, "%s", item);
if (strcmp(item, "AUCTION") == 0) {
int auctionNumber;
fscanf(ifp, "%d", &auctionNumber);
totalRevenue += awardAuction(auctions, auctionNumber);
}
else if (strcmp(item, "RAFFLE") == 0){
int raffleNumber, winner;
fscanf(ifp, "%d%d", &raffleNumber, &winner);
awardRaffle(raffles, raffleNumber, winner);
}
}
else {
printf("TOTALREVENUE is $%.2lf.\n", totalRevenue);
}
}

fclose(ifp);
return 0;
}
void initRaffle(int raffles[MAXRAFFLE]) {

}
void initAuction(float auction[2][MAXAUCTIONITEMS]) {

}
void buyTickets(float * totalRevenue, int * ticketsSold, int numTickets, float price) {

}


void buyRaffle(float * totalRevenue, int raffles[MAXRAFFLE], int availTickets, int numTickets, int person) {}// Pre-conditions: auction is an 2D array that holds the current highest bid and the person with

void bid(float auction[2][MAXAUCTIONITEMS], float bid, int auctionNumber, int person, int flag) {

}
float awardAuction(float auction[2][MAXAUCTIONITEMS], int auctionNumber) {}
void awardRaffle(int raffles[MAXRAFFLE], int raffleNumber, int winner) {}

In: Computer Science

Java Program using inheritance, create a program that will take input from the user to answer...

Java Program

using inheritance, create a program that will take input from the user to answer this information: (Create a method for home, car, and personal loan) Thanks!

montly income= 80,000
extra income=30,000
any libality=40,000
total income=80,000+30,000-40,000=?

eligibility for homeloan=total_income*80% for home loan
eligibility for car loan=total_income*60% for carloan
eligibility for personal loan=total_income*70% for personal loan

In: Computer Science

Discuss the main technical issues facing global systems.

Discuss the main technical issues facing global systems.

In: Computer Science

1. Define a Student class , Student class has the follow data fields added---- major: String...

1. Define a Student class , Student class has the follow data fields added---- major: String gpa: double studentID: String // unique id (Find a solution to manage the generation of unique “studentID”) Methods: double getGPA(); void setGPA(); getMajor(String major) void changeMajor(); 2 String toString(); // of major and GPA ,boolean equals(Object o); // 2 students are equal if them have same // personal information plus same student ID String getNextUniqueID(); // this method should be declared as static.

2.  Redesign Student class : (a) Remove “gpa” data field and related methods (b) Add data field: courses:ArrayList (c) Add the following methods: • boolean addCourse(MyCourse course); // add a course to courses list • boolean removeCourse(Course course); // remove a course from the courses list // based on the course information (courseID) in Course object • boolean removeCourse(int courseID); // search and remove a course from the list // based on the unique courseID • ArrayList getCourseList(); • String getCourseGrade(int courseID); // search for a course by courseID from // “courses” list; if not exist, return “no taken”; otherwise, return a grade // by mapping status to “W”(withdraw), “IP” (in progress), or “A” through // “F” (mapping score to these grades) • double getAverageGPA(); // select courses which have taken from “courses”; // map grade “A” through “F” to 4.0 through 0.0; then calculate // average GPA • toString(), equals()

In: Computer Science

Java Logic - the idea is for this Plumbers.java to ask the customer if there house...

Java Logic - the idea is for this Plumbers.java to ask the customer if there house is flooded , how many rooms, if pipes were damaged and if so how many.. then to pas that information into the plumber constructore and the bill for the services. The ComputePrice() isn't displaying the info and the switches aren't taking in the informations in the display().

import java.util.Scanner;

              
public class Plumber
{
  
   int service;
   int numberRooms;
   int burstPipes;
   int numberPipes;
   double roomsCost;
   double pipesCost;
   private int NumberRooms;
   double cFlood1 = 300.00;
   double cFlood2 = 500.00;
   double cFlood3 = 750.00;
   double cPipe1 = 50.00;
   double cPipe2 = 70.00;
   double cPipe3 =100.00;
   double cost = 0;
   String BurstPipes ="";

    private Plumber(int srv, int numRms, int bstPipes, int numPipes)
    {  
      service = srv;
      numberRooms = numRms;
      burstPipes = bstPipes;
      numberPipes = numPipes;
    }

    private Plumber(int service, int numberRooms, String burstPipes, int numberPipes) {
   
      this.service = service;
      this.numberRooms = numberRooms;
      this.BurstPipes = burstPipes;
      this.numberPipes = numberPipes;
    }



     public void display()
          {
      String p1 = " no rooms flooded",
             p2 = "1 room flooded",
             p3="with 2 rooms flooded",
             p4="with 3 or more rooms flooded",
             p5="\n no burst pipes apparent\n",
             p6="\n and 1 burst pipe apparent\n",
             p7="\n and 2 burst pipes apparent\n",
             p8="\n and 3 burst pipes apparent\n";
              
          
              
               if(service == 1)
              
                   {
                        System.out.println("\nYou have stated that the damage to your house involves a natural flood.");
                       
                            switch(NumberRooms)
                            {
                                case 0:
                                    System.out.printf("%s",p1);
                           
                                case 1:
                                    roomsCost += cFlood1;
                                    System.out.printf("%s",p2);
                                    break;
                                case 2:
                                    roomsCost += cFlood2;
                                    System.out.printf("%s",p3);
                                    break;
                                case 3:
                                    roomsCost += cFlood3;
                                    System.out.printf("%s",p4);
                                    break;
                                
                                }
                              
                                
                    if(BurstPipes.equals("Y") || BurstPipes.equals("y"))
                         {
                            switch(burstPipes)
                            {
                            
                                case 0:
                                     System.out.printf("%s",p5);
                                     break;
                                case 1:
                                    pipesCost += cPipe1;
                                    System.out.printf("%s",p6);
                                    break;
                                case 2:
                                    pipesCost += cPipe2;
                                    System.out.printf("%s",p7);
                                    break;
                                case 3:
                                    pipesCost += cPipe3;
                                    System.out.printf("%s",p8);
                            }
                        
                    
                        }
                    
                    }
               
                }


   public void ComputePrice()
   {
      if(service ==1)     
         cost = roomsCost + pipesCost;
     
         if(!(roomsCost==0))
            System.out.printf("\n%s Room Flood Repair = $%s\n",numberRooms,roomsCost);
     
         if(!(pipesCost==0))
       
         {
            System.out.printf("%s Pipe Repair = $%s\n",numberPipes,pipesCost);
     
         System.out.printf("                 ------------\n" +
         "Estimated Amount Due: $%s\n\n",cost);
     
         System.out.print("** Please Have This Amount Available -" +
         "   Fees Are Due At Time Of Service.\n   This Is An Estimate Only." +
         " Final Bill Will Be Based On Onsite Evaluation." +
         "\n   All Work Will Be Discussed And Agreed Upon Prior To Repairs. **\n\n");
      }
  
      else
    
         System.out.printf("If you need services, please come visit us again.\n\n");        
               
           
    }




   public static void main(String[] args)
   {

   double cFlood1 = 300.00;
   double cFlood2 = 500.00;
   double cFlood3 = 750.00;
   double cPipe1 = 50.00;
   double cPipe2 = 70.00;
   double cPipe3 =100.00;
   double roomsCost;
   double pipesCost;
   double cost = 0.00;
   int service;
   int numberRooms;
   int numberPipes;
   String burstPipes ="";

  
  
  
  

   Scanner userInput = new Scanner(System.in);
  
   System.out.print("\nPlease enter 1 "+ "if there was flood damage>>");
   service = userInput.nextInt();
   System.out.print("\n How many rooms were flooded - 1" + "2" + "3" + "or more >>");
   numberRooms = userInput.nextInt();
   burstPipes = userInput.nextLine();
   System.out.print("\n Were there any burst pipes? Please enter Y" + "or" + "N >>");
   burstPipes = userInput.nextLine();
   System.out.print("\n How many pipes burst? - 1" + "2" + "3" + "or more>>");
   numberPipes = userInput.nextInt();


   Plumber firstCustomer = new Plumber(service, numberRooms, burstPipes,numberPipes);

   firstCustomer.ComputePrice();
   firstCustomer.display();

   }

}

In: Computer Science

Consider a file system using a multi-level indexing scheme in inodes as the file organization. In...

Consider a file system using a multi-level indexing scheme in inodes as the file organization. In this question, you are going to compare symbolic linking with hard linking.

i. (3%) Consider creating a symbolic link abc.txt in the current directory /usr/local/ that links to the file /home/c3230a/intro.txt. Which filesystem data structures need to be involved and/or updated?

ii. (3%) Consider creating a hard link abc.txt in the current directory /usr/local/ that links to the file /home/c3230a/intro.txt. Which filesystem data structures need to be involved and/or updated?

In: Computer Science

TRANSPARANT DATA ENCRYPTION TOPIC INTRODUCTION 150WORDS, DESCRIPTION 250 WORDS,  CONCLUTION 150 WORDS USE OWN WORDS 500 WORDS....

TRANSPARANT DATA ENCRYPTION TOPIC INTRODUCTION 150WORDS, DESCRIPTION 250 WORDS,  CONCLUTION 150 WORDS USE OWN WORDS 500 WORDS. WITH REFERENCE SAFEASSIGN NEEDED

In: Computer Science

Create a class named GroceryList. The attributes will be threeLinkedLists. One LinkedList holds double (currency) values,...

Create a class named GroceryList. The attributes will be threeLinkedLists. One LinkedList holds double (currency) values, one holds integer values, and the last holds String values. The String LinkedList is a list of grocery item names. The double LinkedList holds the cost of that item. The integer LinkedList is the number of those items being purchased.

The constructor will simply create empty lists.

The following are the methods to create for this class:

1. add(String, cost, quantity) : Add the specified items to the next position on each LinkedList (note that will ensure that the index of each item is the same on both LinkedLists).

2. remove(String) : Remove the specified item from BOTH lists. This means find it in the String LinkedList, save that index, and then remove the item at that index from each list.

3. bill() : This method will return the total cost of the items being purchased.

4. receipt() : This method will print the name of each item being purchased, how many of those items are being purchased, and the total cost of that item. The last line will be the total cost of all items being purchased.

java language and it's not custom

In: Computer Science

.Variable created outside of function in the main script are available within the function. (Explain by...

  • .Variable created outside of function in the main script are available within the function. (Explain by giving an example)
    • a/
  • is it possible to include HTML in a PHP script file?explain by giving an example
  • here is a constant: define (“LocalHost”,”127.0.0.1”);
    • which one of the following is the correct way to refer to the above constant?
  • LocalHost
    • b.$LocaolHost
  • how many times will ”I love PHP programming!”be printed in the following program segment?
    • $count = 0
    • While ($count<10)
    • eco
  • the PHP function isset() only returns false if a parameter name is missing. It still returns true if the parameter name exists. True or false
  • Data submitted through the HTTP post method is store in array $_POST. True or false
  • Create an array and call it products that will contain the following key and value pairs:
    • i.”iphone “ :699
    • j.”blackberry” :300
    • k.”Samsung” :799
    • l.”Nokia” : 120
    • use a foreach loop to display the content of this array. Make sure to display both the key and value.
  • What will be the output of the following script?
    • <?php
      • $numbers = [100 , 200 ,300,400] ;
      • $values = array(“Hello”,”world”,from”,”csci2006” );
        • For ($i < count ( $numbers) ; $i++)
        • {              
          • echo “numbers[$i] = “ .$numbers[$i] . “<br /> “;
          • echo “values[$i] . “<br />”;
        • }
    • ?>
  • What classes of information are available via the $_server super global array?

In: Computer Science

IN JAVA 1.Write a class Item with these following requirements ØHas two properties: itemName (text) and...

IN JAVA 1.Write a class Item with these following requirements

ØHas two properties: itemName (text) and MSRP (decimal)

ØHas a getTax() method that has no implementation. This method returns a decimal value

ØHas a finalPrice() method that returns the price after tax

ØThis class cannot be instantiated

ØThis class is encapsulated

2.Write a class Electronics that inherits Item with these following requirements

ØHas two properties: manufacturer (text) and tax (decimal). tax value is shared among all electronic items

ØHas a constructor that initializes all attributes

ØProvide an implementation for getTax()

ØThis class is encapsulated

3.Write a class Shop that sells electronic items with these following requirements

ØHas two properties: shopName (text) and itemSold (collection). itemSold stores all the items that the shop sold. You can choose any Java built-in collection type that you like

ØHas a constructor (you can decide which input to have)

ØHas a method sellItem() that add a sold item to itemSold

ØHas a method getSoldList() that returns the names of all items sold in an array. This method shows an error when the collection is empty

ØThis class is encapsulated

4.Write a class Test that creates a Shop, sells a few items, then test getSoldList() and sortSoldList()

ØAssuming tax rate is 7%

In: Computer Science

Discuss in details the strategic benefits of Business Inelegance systems

Discuss in details the strategic benefits of Business Inelegance systems

In: Computer Science

Write a C++ program to read in various types of test questions (multiple choice and True/False)...

Write a C++ program to read in various types of test questions (multiple choice and True/False) from a test bank (text file), and load the questions into an array of questions. You will need to implement the following class hierarchy (given in UML):

Once the test bank has been loaded, simply iterate over the array of questions and have each question printed out to the screen.

The test bank (text file) will have the following format:

  • Line 1 will be an integer value, indicating how many questions in the file
  • Each question will start with a line that starts with either "MC" or "TF" followed by a space and then the point value of the question.
  • The next line will be the actual question.
  • If the question was True/False, the following line will be the answer, either "True" or "False"
  • If the question was multiple choice, the following line will be an integer value indicating how many choices will be provided for that question. The following lines will be the choices. There will never be more than 6 choices. The final line following the choices will be the answer: "A" or "B" or "C" or "D" or "E" or "F".

For this assignment, you may download this sample code for reference. A sample test bank file is as follows:

3

TF 5

There exist birds that cannot fly?

true

MC 10

Who was the President of the USA in 1991?

6

Richard Nixon

Gerald Ford

Jimmy Carter

Ronald Reagan

George Bush Sr.

Bill Clinton

E

TF 10

The city of Boston hosted the 2004 Summer Olympics?

false

In: Computer Science