subject

Define the following Prolog predicates:

(a) increasing(List) which is true if List is a monotonically increasing list of numbers (e. g. [1,1,3,4,5,5,5,7])

(b) decreasing(List) which is true if List is a monotonically decreasing list of numbers (e. g. [7,7,5,5,3,2,1,1]

(c) sorted(List) which is true if List is sorted (increasingly or decreasingly)

(d) analyze(List) which displays the message ‘This list is sorted’, or ‘This list is not sorted’ depending on the values in the list.

(e) minplusmax(List, MinPlusMax) which returns the sum of the minimum and the maximum element of the List

Notes: (1) Performance of these predicates is not critical (all reasonable solutions are OK); (2) monotonically increasing means that each value is less than or equal to the next value ; (3) in definitions of new predicates, you may use your previously defined predicates.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
Wich technology can a website use to allow you to listen to a concert live over the internet?
Answers: 3
question
Computers and Technology, 22.06.2019 22:50
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
question
Computers and Technology, 23.06.2019 04:20
4. a1. vince owns a television repair shop that is insured undera commercial package policy. the policy includes thebuilding and personal property coverage form and thecauses-of-loss broad form. the declarations page indicatesthat coverage applies to both the building and the namedinsured's business property. explain whether or not thefollowing losses would be covered under his policy.a. a fire occurs on the premises, and the building isbadly damaged.b. a burglar steals some money and securities from anunlocked safe.c. a business computer is damaged by vandals whobreak into the shop after business hours.d. a tornado touches down near the store. several tel-evision sets of customers in the shop for repair aredamaged in the storm.til
Answers: 2
question
Computers and Technology, 23.06.2019 19:00
Acompany is hiring professionals for web designing. the firm is small with few resources. they want employees who possess problem-solving skills and can independently carry out responsibilities. which kind of employee should they select?
Answers: 2
You know the right answer?
Define the following Prolog predicates:

(a) increasing(List) which is true if List is a...
Questions
question
Mathematics, 06.12.2020 07:30
question
Mathematics, 06.12.2020 07:30
question
Health, 06.12.2020 07:30
question
Social Studies, 06.12.2020 07:30
question
Spanish, 06.12.2020 07:30
question
Mathematics, 06.12.2020 07:30
Questions on the website: 13722367