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
Kisachek [45]
3 years ago
5

Write a program with a "function" named "getMinFromInput()" that reads a list of integers from the keyboard and returns the smal

lest "positive" number entered. For example, if user enters 0 3 -2 5 8 1, it should return 1. The reading stops when 999 is entered.
Your main function should call this getMinFromInput() function and print out the smallest "positive" number. c++

#include
using namespace std;

int main() {

/* Type your code here. */

return 0;
}
Computers and Technology
1 answer:
ella [17]3 years ago
4 0

Answer:

ypite58eitetustietiejtejtejte6jhyeyry7ryjr

You might be interested in
Conflict on cross-cultural teams
mars1129 [50]

Answer:

A : is inevitable and should just be ignored until it blows over

Explanation:

Hopefully this helps!

3 0
3 years ago
Read 2 more answers
Which unit of the computer works of the output?​
Mrac [35]

Answer:

monitor

Explanation:

this is because monitor displays information so it an output

3 0
3 years ago
Pros and cons of the inter's<br> ability to access information
SpyIntel [72]
Pros and cons of the internet are the pros you can get the informaqtion needed to research and find out any information at your finger tips and get the answerws you need to certqin things fast. The cons the main one ise the people who misuse this to st4eal your information and indenity.
7 0
3 years ago
What can be controlled through IoT? Choose four answers.
BaLLatris [955]

Answer:

Door locks

Light switches

Security cameras

Thermostat

Explanation:

IoT is internet of things that means network of different things that are interconnected through internet and make the decision with the help of Electronic sensors. The sensor sense the data from environment at different times and send this to the cloud (that may be the server). On the basis of this data different devices such as door looks, light switches, security cameras and thermostat take decisions with the help of controllers and change their current state.

<u>For Example</u>

In case of door look, there may be sensor that is sensing the finger prints of the user and after recognizing the person the door will be unlock. If unauthenticated user will try to open the lock a message has been sent to concerned. The training data of the the authorized persons is saved on the cloud, whenever someone tries to access, the data from sensor and cloud send to controller for making comparison and decision. So we can say that Door lock can be controlled IoT.

In case of light switches, there are few sensor available to sense the intensity of life. Different training values of that sensors are stored on the cloud. Whenever these sensors sense the light intensity, they send the data to the cloud contentiously, whenever the data match with darkness intensity, a signal has been send from controller to the switch to ON the lights.

Same as in cameras and Thermostat both are sending data to the cloud and controller. With the help of different image processing techniques and sensor camera will take the decision related to face recognition. Thermostat devices are also on and off by variation of temperature.

7 0
4 years ago
Write a removeDuplicates() method for the LinkedList class we saw in lecture. The method will remove all duplicate elements from
oksano4ka [1.4K]

Answer:

removeDuplicates() function:-

//removeDuplicates() function removes duplicate elements form linked list.

   void removeDuplicates() {

     

       //declare 3 ListNode pointers ptr1,ptr2 and duplicate.

       //initially, all points to null.

       ListNode ptr1 = null, ptr2 = null, duplicate = null;

       

       //make ptr1 equals to head.

       ptr1 = head;

        //run while loop till ptr1 points to second last node.

       //pick elements one by one..

       while (ptr1 != null && ptr1.next != null)

       {

               // make ptr2 equals to ptr1.

               //or make ptr2 points to same node as ptr1.

           ptr2 = ptr1;

           //run second while loop to compare all elements with above selected element(ptr1->val).

           while (ptr2.next != null)

           {

              //if element pointed by ptr1 is same as element pointed by ptr2.next.

               //Then, we have found duplicate element.

               //Now , we have to remove this duplicate element.

               if (ptr1.val == ptr2.next.val)

               {

                  //make duplicate pointer points to node where ptr2.next points(duplicate node).

                       duplicate = ptr2.next;

                       //change links to remove duplicate node from linked list.

                       //make ptr2.next points to duplicate.next.

                   ptr2.next = duplicate.next;

               }

               

             //if element pointed by ptr1 is different from element pointed by ptr2.next.

               //then it is not duplicate element.

               //So, move ptr2 = ptr2.next.

               else

               {

                   ptr2 = ptr2.next;

               }

           }

           

           //move ptr1 = ptr1.next, after check duplicate elements for first node.

           //Now, we check duplicacy for second node and so on.

           //so, move ptr1  by one node.

           ptr1 = ptr1.next;

       }

   }

Explanation:

Complete Code:-

//Create Linked List Class.

class LinkedList {

       //Create head pointer.

       static ListNode head;

       //define structure of ListNode.

       //it has int val(data) and pointer to ListNode i.e, next.

   static class ListNode {

       int val;

       ListNode next;

       //constructor to  create and initialize a node.

       ListNode(int d) {

               val = d;

           next = null;

       }

   }

//removeDuplicates() function removes duplicate elements form linked list.

   void removeDuplicates() {

       

       //declare 3 ListNode pointers ptr1,ptr2 and duplicate.

       //initially, all points to null.

       ListNode ptr1 = null, ptr2 = null, duplicate = null;

       

       //make ptr1 equals to head.

       ptr1 = head;

       

       

       //run while loop till ptr1 points to second last node.

       //pick elements one by one..

       while (ptr1 != null && ptr1.next != null)

       {

               // make ptr2 equals to ptr1.

               //or make ptr2 points to same node as ptr1.

           ptr2 = ptr1;

           //run second while loop to compare all elements with above selected element(ptr1->val).

           while (ptr2.next != null)

           {

              //if element pointed by ptr1 is same as element pointed by ptr2.next.

               //Then, we have found duplicate element.

               //Now , we have to remove this duplicate element.

               if (ptr1.val == ptr2.next.val)

               {

                  //make duplicate pointer points to node where ptr2.next points(duplicate node).

                       duplicate = ptr2.next;

                       

                       //change links to remove duplicate node from linked list.

                       //make ptr2.next points to duplicate.next.

                   ptr2.next = duplicate.next;

               }

               

             //if element pointed by ptr1 is different from element pointed by ptr2.next.

               //then it is not duplicate element.

               //So, move ptr2 = ptr2.next.

               else

               {

                   ptr2 = ptr2.next;

               }

           }

           

           //move ptr1 = ptr1.next, after check duplicate elements for first node.

           //Now, we check duplicacy for second node and so on.

           //so, move ptr1  by one node.

           ptr1 = ptr1.next;

       }

   }

   //display() function prints linked list.

   void display(ListNode node)

   {

       //run while loop till last node.

       while (node != null)

       {

               //print node value of current node.

           System.out.print(node.val + " ");

           

           //move node pointer by one node.

           node = node.next;

       }

   }

   public static void main(String[] args) {

       

       //Create object of Linked List class.

       LinkedList list = new LinkedList();

       

       //first we create nodes and connect them to form a linked list.

       //Create Linked List 1-> 2-> 3-> 2-> 4-> 2-> 5-> 2.

       

       //Create a Node having node data = 1 and assign head pointer to it.

       //As head is listNode of static type. so, we call head pointer using class Name instead of object name.

       LinkedList.head = new ListNode(1);

       

       //Create a Node having node data = 2 and assign head.next to it.

       LinkedList.head.next = new ListNode(2);

       LinkedList.head.next.next = new ListNode(3);

       LinkedList.head.next.next.next = new ListNode(2);

       LinkedList.head.next.next.next.next = new ListNode(4);

       LinkedList.head.next.next.next.next.next = new ListNode(2);

       LinkedList.head.next.next.next.next.next.next = new ListNode(5);

       LinkedList.head.next.next.next.next.next.next.next = new ListNode(2);

       //display linked list before Removing duplicates.

       System.out.println("Linked List before removing duplicates : ");

       list.display(head);

       //call removeDuplicates() function to remove duplicates from linked list.

       list.removeDuplicates();

       System.out.println("")

       //display linked list after Removing duplicates.

       System.out.println("Linked List after removing duplicates :  ");

       list.display(head);

   }

}

Output:-

6 0
3 years ago
Other questions:
  • How do Filament 3D printers build a model?
    8·1 answer
  • An object is suspended in a wind tunnel and the force measured for various levels of wind velocity: v (m/s) 10 20 30 40 50 60 70
    10·1 answer
  • Which two tasks are responsibilities of a network administrator?
    8·1 answer
  • What does network administration normally include? Check all of the boxes that apply.
    8·1 answer
  • What can your employer do to protect you from overhead power lines?
    13·1 answer
  • Is it possible to have a deadlock involving only oneprocess? Explain your answer.
    11·1 answer
  • Raj needs to apply sorting to a current list in his Word document.
    9·2 answers
  • The internet's data gathways rely on what kind of hardware devies to route data to its destination?
    14·1 answer
  • Grade 11 essay about the year 2020​
    9·1 answer
  • consider l= 5 ,r= 11. you must determine the sum of the values of the function in the range L to R . you have to calculate sum =
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!