2021-06-15 00:49:18 -07:00
---
id: 5a23c84252665b21eecc7eb0
2021-07-30 01:41:44 +09:00
title: I prima di E eccetto dopo C
2021-06-15 00:49:18 -07:00
challengeType: 5
forumTopicId: 302288
dashedName: i-before-e-except-after-c
---
# --description--
2021-07-30 01:41:44 +09:00
["I before E, except after C" ](https://en.wikipedia.org/wiki/I before E except after C ) è una frase mnemonica che dovrebbe aiutare con la scrittura delle parole inglesi.
2021-06-15 00:49:18 -07:00
2021-07-30 01:41:44 +09:00
Utilizzando le parole fornite, verificare se le due sotto-clausole della frase sono plausibili singolarmente:
2021-06-15 00:49:18 -07:00
< ol >
< li >
< i > "I before E when not preceded by C".< / i >
< / li >
< li >
< i > "E before I when preceded by C".< / i >
< / li >
< / ol >
2021-07-30 01:41:44 +09:00
Se entrambe le sotto-frasi sono plausibili allora la frase originale è plausibile.
2021-06-15 00:49:18 -07:00
# --instructions--
2021-07-30 01:41:44 +09:00
Scrivi una funzione che accetta una parola e controlla se essa segue questa regola. La funzione dovrebbe rispondere true se la parole segue la regola altrimenti dovrebbe rispondere false.
2021-06-15 00:49:18 -07:00
# --hints--
2021-07-30 01:41:44 +09:00
`IBeforeExceptC` dovrebbe essere una funzione.
2021-06-15 00:49:18 -07:00
```js
assert(typeof IBeforeExceptC == 'function');
```
2021-07-30 01:41:44 +09:00
`IBeforeExceptC("receive")` dovrebbe restituire un booleano.
2021-06-15 00:49:18 -07:00
```js
assert(typeof IBeforeExceptC('receive') == 'boolean');
```
2021-07-30 01:41:44 +09:00
`IBeforeExceptC("receive")` dovrebbe restituire `true` .
2021-06-15 00:49:18 -07:00
```js
assert.equal(IBeforeExceptC('receive'), true);
```
2022-02-18 00:29:34 +05:30
`IBeforeExceptC("science")` dovrebbe restituire `false` .
2021-06-15 00:49:18 -07:00
```js
assert.equal(IBeforeExceptC('science'), false);
```
2021-07-30 01:41:44 +09:00
`IBeforeExceptC("imperceivable")` dovrebbe restituire `true` .
2021-06-15 00:49:18 -07:00
```js
assert.equal(IBeforeExceptC('imperceivable'), true);
```
2021-07-30 01:41:44 +09:00
`IBeforeExceptC("inconceivable")` dovrebbe restituire `true` .
2021-06-15 00:49:18 -07:00
```js
assert.equal(IBeforeExceptC('inconceivable'), true);
```
2021-07-30 01:41:44 +09:00
`IBeforeExceptC("insufficient")` dovrebbe restituire `false` .
2021-06-15 00:49:18 -07:00
```js
assert.equal(IBeforeExceptC('insufficient'), false);
```
2021-07-30 01:41:44 +09:00
`IBeforeExceptC("omniscient")` dovrebbe restituire `false` .
2021-06-15 00:49:18 -07:00
```js
assert.equal(IBeforeExceptC('omniscient'), false);
```
# --seed--
## --seed-contents--
```js
function IBeforeExceptC(word) {
}
```
# --solutions--
```js
function IBeforeExceptC(word)
{
if(word.indexOf("c")==-1 & & word.indexOf("ie")!=-1)
return true;
else if(word.indexOf("cei")!=-1)
return true;
return false;
}
```