1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vitfil [10]
3 years ago
11

Write an expression that continues to bid until the user enters 'n'. Sample output with inputs: 'y' 'y' 'n' I'll bid $7! Continu

e bidding? I'll bid $15! Continue bidding? I'll bid $23! Continue bidding?
Computers and Technology
1 answer:
Likurg_2 [28]3 years ago
4 0

Answer:

#include <iostream>

#include <cstdlib>  

using namespace std;

int main() {

  char Keep_Going = '-';

  int nextBid = 0;

  srand(5);

  while (Keep_Going != 'n') { //<-- solution

     nextBid = nextBid + (rand()%10 + 1);

     cout << "I'll bid $" << nextBid << "!" << endl;

     cout << "Continue bidding? ";

     cin >> Keep_Going;

  }

  cout << endl;

  return 0;

}

You might be interested in
Templates are great to use because they
Stolb23 [73]

Answer:

a&b would be equal so the answer would be undefined

Explanation:

6 0
3 years ago
Select all the correct answers.
monitta

approvals necessary to bypass the policy

6 0
3 years ago
Read 2 more answers
What function can be used to detect when the end of an input file has been reached?
il63 [147K]

Answer:

getc() or feof() in c/c++.

Explanation:

getc() returns EOF(End of File) when the end of the file reached is reached but it is not efficient because it also return EOF when it fails.

feof() returns non-zero value when the EOF is reached otherwise it return 0.So feof() is an efficient method to read a file.

For example:-

#include <stdio.h>    

int main()  

{  

 FILE *f = fopen("sample.txt", "r");  

 int c = getc(f);  

 while (c!= EOF)  

 {  

    putchar(ch);  

   ch = getc(f);  

 }  

 if (feof(f))  

    printf("\n File has ended.");  

 else  

    printf("\n Reading not happened.");  

 fclose(f);

 getchar();  

 return 0;  

}

7 0
3 years ago
Hi<br> How do I mark someone as brainliest
alexdok [17]

Answer:

whenever they answer a question it should say at the top right give brainliest

Explanation:

4 0
3 years ago
Read 2 more answers
Write a program that will generate a personalized invitation within a text file for each guest in the guest list file using the
vlada-n [284]

Answer:

Code:  

import os   # os module to create directory  

event_file = open("event_details.txt", "r") # Getting event file  

event_details = ""  # event details to be stored  

for row in event_file:  # traversing through the event_file  

   event_details += row    # appending event details  

os.mkdir("./invitations")   # make directory in the same parent directory  

names = open("guest_list.txt", "r") # getting names of the people  

for name in names:  # traversing through names in guest_list file

   name = name.replace('\n', '')   # removing the ending '\n' from the name  

   invitation_msg = "Hi! " + name + ", You are heartly invited in the Ceremony.\nAt " + event_details # Generating the invitation message  

   file_name = '_'.join(name.split(' '))   # Spliting name in space and joining with the '_'  

   file_path = "./invitations/" + file_name + ".txt" # Generating each file path  

   invite_file = open(file_path, "w")  # Creating the file for each name  

   invite_file.write(invitation_msg)   # Write invitation to file

Output:

7 0
3 years ago
Other questions:
  • A company decides to create static design diagrams for an upcoming project. Which statement correctly describes the attribute of
    6·1 answer
  • Many languages do not use the characters of U.S. English. Suppose you wanted to be able to encode the characters of every langua
    10·1 answer
  • A database is a collection of ________ data.
    15·1 answer
  • In today's workplace, most employers issue a policy stating that they will monitor employees' use of any company-owned computer,
    5·1 answer
  • The mutating-table error is raised when a trigger attempts to execute a. an INSERT, UPDATE, or DELETE while another user is upda
    10·1 answer
  • Assume that strikeCounter has already been declared to be a "pointer to int". Assume further that strikeCounter has been initial
    5·1 answer
  • Four kinds of information a writer must document are: _____. A) common knowledge information B) direct quotation summary of a di
    11·1 answer
  • F1: 2^14 formula ....................................................................
    10·1 answer
  • Five types of conflict in the school​
    9·2 answers
  • A client is looking to maximize value from its Cloud investments by baselining, profiling, and prioritizing its human capital ne
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!