Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hi I have a typescript program but i dont know why it doenot work can you help me fix it errors: code: 'use strict' 10

hi I have a typescript program but i dont know why it doenot work can you help me fix it

errors:

image text in transcribed

code:

'use strict' 10 11 // Function to print pattern recursively >> 12 function printPattern(integer: number) { 13 >> 14 if (number> 16 if (number >= 5) { >> 17 return (printPattern(number - 1) + " " + number >> 18 + printPattern(number - 1)+" "+" "); 19 } else { >> 20 return (printPattern(number - 1) + " " + number >> 21 + printPattern(number-1)); 22 } 23 } 24 } 25 26 var number = console.log("Enter a number between 1 to 15"); 27 28 // check range value >> 29 if (number 15) { 30 console.log("Error: Worng input"); 31 } else { 32 console.log("User input | Program output "+ >> 33 number+" | "+printPattern(number)+" "); 34 }

12 function printPattern(integer: number) { NNNN src/index.ts:14:9 error TS2365: Operator '=' cannot be applied to types 'void' and 'number'. 16 if (number >= 5) { src/index.ts:17:34 nt' or an enum type. error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigi 17 return (printPattern(number 1) + " " + number NNNNNN src/index.ts:18:36 nt' or an enum type. error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigi 18 + printPattern(number 1)+" "+" "); NNNNN src/index.ts:20:34 nt' or an enum type. error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigi 20 return (printPattern(number 1) + Activate Windows Go to Settings to activate Windows. + number

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago