Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a C++ program called PositiveNumbers.cpp.

The program must do the following:

 Prompt user to enter a positive number that is greater than 0 or a -1 to quit (See Figure 4.1).

NB: Make use of a post-test loop

 If the number is within the range, determine the following :

o how many numbers are entered,

o the total (sum) of all numbers entered,

o determine how many are even numbers and,

o determine the highest number entered.

 If the number is invalid display and appropriate message as indicated in Figure 4.2.

 This process must be repeated until an invalid number is entered (-1).When the process terminates, display the following (See Figure 4.1 and Figure 4.3)

o the total of the numbers entered,

o the total number of even numbers,

o the highest number and

o the sum of all numbers entered.


how to create friend list in c#


Make a c++ program of a simple menu program of the sample run below.


Sample Run:


Difficulty Levels

      1. - Easy

      2. - Normal

      3. - Hard

Choice : 1

 You picked Easy.

Play another game? (y/n): y

Difficulty Levels

      1. - Easy

      2. - Normal

      3. - Hard

Choice : 2

You picked Normal.

Play another game? (y/n): y

Difficulty Levels

      1. - Easy

      2. - Normal

      3. - Hard

Choice : 3

 You picked Hard.

Play another game? (y/n): y

Difficulty Levels

      1. - Easy

      2. - Normal

      3. - Hard

Choice : 4

Illegal Choice. Please try again.

Play another game? (y/n): y

Difficulty Levels

      1. - Easy

      2. - Normal

      3. - Hard

Choice : 2

You picked Normal.

Play another game? (y/n): n

Thanks for playing…

This terminates the process.

[ So, this portion the cycles repeat until expression test false,

 at which point the loop ends.]


Draw the queue structure in each case when the following operations are performed on an empty queue.

(a) Add A, B, C, D, E, F

(b) Delete two letters

(c) Add G

(d) Add H

(e) Delete four letters

(f) Add I


Ben recently joined in Coding club in his college. On the first day, he got an assignment. He needs to display the numbers as shown in the sample output. Help Ben by writing a suitable program for the pattern.


Input Format


Enter the number of rows(N) in a single line.


Constraints


1≤N≤20


Output Format


Pattern as shown in the sample output.


Sample Input 0


5

Sample Output 0


1 2 3 4 5

16     6

15     7

14     8

13 12 11 10 9

Sample Input 1


7

Sample Output 1


1 2 3 4 5 6 7

24        8

23        9

22        10

21        11

20        12

19 18 17 16 15 14 13


Write a program to output the following:

**********
*        *
* PYTHON *
*        *
**********





 Construct an algorithm that will input values for A and B. Compare the two values inputted and print which of the values is higher including the remark “Higher”.


class Book
{
    int bookIsbnNo;
    String author;
    String publisher;
   
}

class Library
{
    String libraryName;
    String address
    String libraryRegno;
    Book[] books;// A library has books
}
Methods

    - getBooks() : returns Array<Book> 
    - showAllBooks() : Print all the books details


class MemberAccount
{
    String name;
    int accountNo;
    Books[] borrowed;
}

Methods

- borrowBooks(Book b) 
- returnBooks(String bookIsbnNo) : returns a Book

Class LibraryHack { Main method class }

Broadly the below task needs to be done

Need to initialize 5 books in Library class default constructor

LibraryHack is the client program, where you have main methord

Based on the user choice , they can view books, borrowbooks or returnbooks

1- View all books in library class

2- Borrowbooks --> add the book in borrowedBooks list of memberaccountclass

3- Returnbooks -> remove the book from borrowedBooks list

1.A student with a temperature from 36.5°C to 37°C will be allowed to write their exams. The value of the students’ temperature will be stored in variable called temperature.


1.1 Write a C++ while clause that will allow the program to execute when the value in the temperature variable is within the required range.

1.2 Which data type of data is the student’s temperature.


1. Consider the for-loop statement in pseudocode below and answer the following questions number = 15

do while (number >=-25)

Display “number = “, number

number = number -2

Loop


1.1 Rewrite the do while loop using a for-loop in a C++ syntax. Write only the for loop statement, do not write the other instructions inside the body of the loop.

1.2 Rewrite the do while loop above in C++ syntax.

1.3 How many times will the loop execute?

1.4 The value of number after execution of the loop.


LATEST TUTORIALS
APPROVED BY CLIENTS