How many lockers will remain open

Assignment Help C/C++ Programming
Reference no: EM132104025

Problem for C++: Suppose there are 50 lockers in a school, each student is standing in front of his/her locker and all the lockers are closed. Now each student starts to close open lockers or open closed lockers starting from their locker to the last locker.

If this starts from the first student till the last student, how many lockers will remain open and how many will remain closed. Solve this problem using array and print the number of open and closed lockers.

Use only conditions, loops, user-defined functions and arrays. (No pointers or extra stuff)

Reference no: EM132104025

Questions Cloud

How many revolutions had huygens completed : How many revolutions had Huygens completed when it was 160 yards from the mother ship?
What force is needed to remove the plug : The container is submerged to a depth of 3.00 m in water. What force is needed to remove the plug?
A stuntman swings from the end : A stuntman swings from the end of a 4.10 m long rope along the arc of a vertical circle.
Rate of energy lost through windows : How do curtains reduce the rate of energy lost through windows? Is it reducing the amount of thermal energy lost through radiation?
How many lockers will remain open : How many lockers will remain open and how many will remain closed. Solve this problem using array and print the number of open and closed lockers.
Describe a covert channel involving the print queue : Describe a covert channel involving the print queue and estimate the realistic capacity of your covert channel.
How to administer the paging to minimize m is an important : The basic model for this is that there are two levels, a large but slow-access main memory, and a small but fast-access memory called the cache.
Create a web page that contains a table of buttons : Create a web page that contains a table of buttons that should apply various styles to a paragraph according to the specifications listed.
Create a query that prompts for students identification : Create a query that prompts for students' identification numbers and returns their timetables for the current semester.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a cpp program that displays your name and address

Write a C++ program that displays your name and address (or if you value your privacy, a fictitious name and address).

  Where do you think cpp and coding games in cpp is headed

Where do you think C++ and coding games in C++ is headed in the next five years? How about in the next 10 years? Do you think there are any significant improvements that need to be made to the code to ensure its stability in an ever-changing techn..

  Write a c function that converts a character to upper case.

Write a C function that converts a character to upper case. The function should have the prototype char to_upper(char ch); The characters given as input to the function are assumed to be in the sets {'a', ..., 'z'} and {'A', ... , 'Z' }. Do not use a..

  Machine that i would like to know

Let's say I have a machine that I would like to know, on average, how much it runs throughout a given day through a percentage value. Every 30 seconds, I will have a device to record the current temperature of the machine. If the machine increases..

  Read in data from an input file (qstr.txt).

It will print the output and say that it is NOT palindrome which leads me to believe it is missing something somehow.

  Member data for faculty number

Create a class Student_info, which inherits class Person, in which member data for faculty number, group and faculty are added. The class contains a constructor, member functions for accessing the data, for change of ID and for displaying the data..

  Draw a sketch of a doubly-linked list

Draw a sketch of a doubly-linked list, specifically of class DLinkedList in DLinkedList.h, containing the first four words of your favorite song.

  Create a program that counts the number of numbers

you need to create a program that counts the number of numbers between 150 and 200 - Can you write this program in c language? You need to implement a function that counts the numbers.

  Questions related to c programming

Which statement will read a floating point value from the keyboard and store it in the variable x? A. printf("float = %f", x); B. scanf("%f", &x); C. scanf("&f", %x); D. scanf("%d", &x);

  Write a program to decide an integer value is power of two

Write a program to decide whether an integer value is power of 2 or not. Your function should return true if the value is power of 2, otherwise return false.

  Program that uses an instance of the timeoff

Write a program that uses an instance of the TimeOff class you designed in Programming Challenge 5. The program should ask the user to enter the number of months an employee has worked for the company. It should then use the TimeOff object to calc..

  How many different variables can be named in c

The name of a variable in the C programming language is a string that can contain uppercase letters, lowercase letters, digits, or underscores.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd